Errors in a Studio Two site's code show up in different places. The kind of error tells you whether the build failed, whether publishing can break the live site, and how to fix it.
| Error type | Where it appears | Stops the build? | Can break the live site? |
|---|---|---|---|
| Code tab problems | Squiggles, the Problems panel, and the problem count in the status bar | Only some. See the next table. | It can, when the problem also stops the build. See Errors and publishing. |
| Build errors | The error indicator in the top bar, the Site code errors panel, and Couldn't prepare site in the status bar | Yes | It can. See Errors and publishing. |
| Runtime errors | The browser console, when the code runs | No | No |
The first table groups errors by where they show up. Each row below is a Code tab problem. The third column shows which of those problems also become build errors, with Couldn't prepare site in the status bar and the error indicator in the top bar.
| Code tab problem | Example | Also a build error? | What else you see |
|---|---|---|---|
| Type error | Type 'string' is not assignable to type 'number' | No | The status bar stays Synced. |
| Syntax error | ';' expected. | Yes | Couldn't prepare site in the status bar, and the error indicator in the top bar. |
| Missing module | Cannot find module './file' or its corresponding type declarations. | Yes | Couldn't prepare site in the status bar, and the error indicator in the top bar. |
A Code tab problem is a problem the Code tab reports as you type. Type errors, syntax errors, and missing modules are all examples of Code tab problems. A syntax error or a missing module also becomes a build error.
The Code tab reports them in three places:
Control+Shift+M (or Command+Shift+M on macOS).A type error stays in the Problems panel and the site still builds. A syntax error or a missing module fails the build. To fix a Code tab problem, open it in the Problems panel and edit that line.
When you change your code, the editor saves it, syncs it, and prepares your site by building its extensions. The status bar at the bottom of the Code tab shows where this process is:
A build error is the Couldn't prepare site state. When the build fails:
[builtin:vite-transform] Unexpected token or [UNRESOLVED_IMPORT] Could not resolve './file'.The editor shows errors caused by your code in the top bar with the red indicator. If the build fails for another reason, such as a temporary issue on Wix's side, you can try again from the Go live with your site panel or by clicking Couldn't prepare site in the status bar.
To fix build errors, click Go to code in the Site code errors panel, edit the line, or click Fix with AI. See Troubleshoot Build Errors.
Building usually takes under a minute. After you fix the code and a new build succeeds, the status bar changes to Synced and the red indicator turns into a green check that disappears after a few seconds.
To fix build errors, edit the line in the Problems panel, or click Fix with AI. See Troubleshoot Build Errors.
The ? icon on the Site code errors panel opens Troubleshoot Build Errors.
A runtime error happens when code that built successfully fails while it runs. The editor doesn't flag it as you type, because the code is valid until it runs.
For code that runs in the visitor's browser, such as an Editor React Component (ERC) click handler:
To fix a runtime error, edit the code that throws. The Problems panel stays clear, because the code built successfully.
Preview includes a Developer Console where you can review your site's logs while you test.
To read log messages from your site's code, open Developer Tools > Logs in the site dashboard. Your code writes these messages with the monitoring client, not with console, and uncaught backend errors appear there automatically. Code that runs in the browser writes log entries only on the live site, not in Preview. Uncaught errors in the browser appear only in the browser's developer console. See About Logs in Studio Two.
Publishing with a build error can break the live site. While the build is failing, and before you publish, the live site still shows the last published version.
Fix build errors before you publish.
The editor still lets you publish. If you click Publish while the build is failing, the Go live with your site panel shows:
Click Publish on the panel to publish anyway. The panel then confirms This site is published.
Warning: Publishing a failed build can replace an ERC on the live site with Element Didn't Load. A syntax error in backend code, or in a function library the ERC doesn't use, can cause this. The rest of the page loads. After you fix the code and publish again, the component loads.
A build error in a dashboard page won't necessarily prevent the site's components from appearing on the page. The dashboard page opens, and its content shows Forbidden. The editor still shows the build error and Code errors may impact your site.
Last updated: 2 November 2026