Claude built me a little web tool, looked great in the code, but the preview panel is just blank. No error, nothing. What gives?
Claude built me a little web tool, looked great in the code, but the preview panel is just blank. No error, nothing. What gives?
Blank preview almost always means the code is trying to do something the preview box doesn't allow. The preview runs in a locked-down sandbox. The number one culprit is localStorage, which Claude sometimes uses to save data, and which simply doesn't work in there. Second most common is loading some library from a URL that's not on the allowed list.
Easiest fix: just tell Claude "the preview is blank" and paste anything from the console if you can see it. It'll usually say "ah, it's the localStorage" and rewrite it.
But honestly, if you only want to use the tool yourself, skip the preview entirely. Download the file, open it in your browser, done. None of those sandbox rules apply on your own machine.