You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Unified Server shows a blank page when running in dev mode. The page JS is never getting loaded due to the way Vite-Express handles the request for inline JS.
In its current form, the index.html for the unified server contains an inline script.1
The 0.js is a reference to the "first inline JS block in the HTML file". Vite extracts this script from the HTML and serves it separately. Presumably to enable things like hot module reload.
Vite-Express does not handle these URLs correctly. Instead, they fall through to the static routing logic, and index.html is returned again. Since the browser expects JS and gets HTML, it logs this error:
Failed to load module script: Expected a JavaScript module script
but the server responded with a MIME type of "text/html".
Strict MIME type checking is enforced for module scripts per HTML spec.
The JS is never loaded or executed, so the resulting page is blank.
In the board-server package, we have a hand-written handler for these requests that defer explicitly to the Vite dev server:
- **Move initialization code out of `index.html` and make
`unified-server` work in dev mode.**
- **Teach `remote-board-server` some more about unified server URLs.**
- **Teach unified server to load assets.**
- **Fix build.**
- **docs(changeset): Make unified server run in dev mode.**
Progress on #4342.
The Unified Server shows a blank page when running in dev mode. The page JS is never getting loaded due to the way Vite-Express handles the request for inline JS.
In its current form, the
index.html
for the unified server contains an inline script.1https://github.com/breadboard-ai/breadboard/blob/4904e2a6b5cc486b722fe38b4fbf7f21408922a2/packages/unified-server/index.html
In production mode, this works fine. The JS is built into the compiled HTML and everything works as expected.
In dev mode, however, the Vite dev server moves the inline script into a JS file with a URL that looks like this:
/@id/__x00__/<repo-path>/index.html?html-proxy&index=0.js
The
0.js
is a reference to the "first inline JS block in the HTML file". Vite extracts this script from the HTML and serves it separately. Presumably to enable things like hot module reload.Vite-Express does not handle these URLs correctly. Instead, they fall through to the static routing logic, and
index.html
is returned again. Since the browser expects JS and gets HTML, it logs this error:The JS is never loaded or executed, so the resulting page is blank.
In the board-server package, we have a hand-written handler for these requests that defer explicitly to the Vite dev server:
breadboard/packages/board-server/src/server/common.ts
Line 94 in 4904e2a
However, it doesn't look like Vite-Express has any such logic.
Need to dig into why this is happening and what can be done about it.
Footnotes
This script was copied more-or-less verbatim from the same file in
visual-editor
. This is fine for the initial build-out, but will be a maintenance issue going forward, and a separate issue has been created to address it. [unified-server] Create a common bootstrap page for the visual editor #4350 ↩The text was updated successfully, but these errors were encountered: