Context
Found while root-causing #18833, then measured at runtime on 2026-09-18. The witness was the in-app browser against a dev server on :57310 serving /Users/Shared/github/neomjs/neo, with dist/production freshly built by build-all at 11:29.
| URL loaded |
neo-config.json request |
result |
what the bundle opens: dist/production/bdd9a773197b1416ba97.html?workspace=probe&theme=neo-theme-neo-dark |
/dist/production/neo-config.json → 404 |
/src/MicroLoader.mjs (the SOURCE loader) → 200, then Failed to fetch dynamically imported module …/dist/production/neo-config.json; nothing boots |
the real app page: dist/production/apps/workstation/index.html?… |
/dist/production/apps/workstation/neo-config.json → 200 |
main.js 200, .neo-viewport renders |
The Problem
apps/workstation/view/WorkspaceController.mjs openTopologyWorkspace() builds the window URL as new URL('../index.html', import.meta.url) (since #18375). webpack treats that pattern as an asset reference. It copies the source apps/workstation/index.html to dist/<env>/<hash>.html and rewrites the call to point there: new URL("../../bdd9a773197b1416ba97.html", import.meta.url) in dist/production/chunks/app/*.js.
The copy keeps the source's <script src="../../src/MicroLoader.mjs">. From dist/production/ that resolves to the source loader, which imports ./neo-config.json relative to the document (src/MicroLoader.mjs). No neo-config.json exists at dist/production/ or dist/development/, so the window's boot aborts.
- Affected:
dist/production, and dist/development, which emits the same kind of asset (dist/development/c2dbf450d3b9188847b7.html, with no dist/development/neo-config.json).
- Unaffected: source, and
dist/esm, which keeps the call unbundled, so import.meta.url is the module's own URL and ../index.html is the real page.
No test observes it. test/playwright/unit/apps/workstation/WorkspaceController.spec.mjs never inspects the URL handed to windowOpen, and the e2e navigates to /apps/workstation/index.html?workspace=… directly.
The Architectural Reality
- The same app's pop-out path already uses the environment-agnostic form.
apps/workstation/view/VesselWorkspace.mjs passes url: './index.html?popout=…&theme=…', which Neo.Main.windowOpen (src/Main.mjs) resolves against the opener document with new URL(url, window.location.href). The opener is <env>/apps/workstation/index.html in every environment.
- A side effect of the fix: this call is the app worker graph's only HTML asset, the one that tripped the webpack 5.111 / minimizer mismatch in #18833. With it gone, the app worker emits no HTML asset.
The Fix
openTopologyWorkspace() builds ./index.html? plus URLSearchParams({workspace, theme}) and passes that relative URL to Neo.Main.windowOpen, matching VesselWorkspace. import.meta.url is no longer used there.
Acceptance Criteria
Out of Scope
- An e2e of the full topology-window flow in dist builds: the e2e suite runs against source.
- Any change to
Neo.Main.windowOpen.
Avoided Traps
/* webpackIgnore: true */ on the new URL(): in a bundle, import.meta.url is the chunk's URL (dist/production/chunks/app/x.js), so ../index.html would still miss (dist/production/chunks/index.html).
- Building the URL from
Neo.config basePath / environment: that is apps/colors' older shape, and it needs per-environment branching the relative URL gets for free.
Related
- #18375 (introduced it) · #18833 (where it surfaced) · #18824 (the vessel route whose shape this adopts)
Live latest-open sweep: checked the latest 20 open issues at 2026-09-18T10:31:30Z; no equivalent, and an all-states search for workstation topology window dist is empty. A2A in-flight sweep: no claim on Workstation or dist. Memory Core sweep: no prior decision. Own-assigned sweep: #18376 is Workstation but a different defect (SharedWorker renderer).
Origin Session ID: 6ed6621f-e2e4-4b9d-9a95-744679cb3c59
Context
Found while root-causing #18833, then measured at runtime on 2026-09-18. The witness was the in-app browser against a dev server on
:57310serving/Users/Shared/github/neomjs/neo, withdist/productionfreshly built bybuild-allat 11:29.neo-config.jsonrequestdist/production/bdd9a773197b1416ba97.html?workspace=probe&theme=neo-theme-neo-dark/dist/production/neo-config.json→ 404/src/MicroLoader.mjs(the SOURCE loader) → 200, thenFailed to fetch dynamically imported module …/dist/production/neo-config.json; nothing bootsdist/production/apps/workstation/index.html?…/dist/production/apps/workstation/neo-config.json→ 200main.js200,.neo-viewportrendersThe Problem
apps/workstation/view/WorkspaceController.mjsopenTopologyWorkspace()builds the window URL asnew URL('../index.html', import.meta.url)(since #18375). webpack treats that pattern as an asset reference. It copies the sourceapps/workstation/index.htmltodist/<env>/<hash>.htmland rewrites the call to point there:new URL("../../bdd9a773197b1416ba97.html", import.meta.url)indist/production/chunks/app/*.js.The copy keeps the source's
<script src="../../src/MicroLoader.mjs">. Fromdist/production/that resolves to the source loader, which imports./neo-config.jsonrelative to the document (src/MicroLoader.mjs). Noneo-config.jsonexists atdist/production/ordist/development/, so the window's boot aborts.dist/production, anddist/development, which emits the same kind of asset (dist/development/c2dbf450d3b9188847b7.html, with nodist/development/neo-config.json).dist/esm, which keeps the call unbundled, soimport.meta.urlis the module's own URL and../index.htmlis the real page.No test observes it.
test/playwright/unit/apps/workstation/WorkspaceController.spec.mjsnever inspects the URL handed towindowOpen, and the e2e navigates to/apps/workstation/index.html?workspace=…directly.The Architectural Reality
apps/workstation/view/VesselWorkspace.mjspassesurl: './index.html?popout=…&theme=…', whichNeo.Main.windowOpen(src/Main.mjs) resolves against the opener document withnew URL(url, window.location.href). The opener is<env>/apps/workstation/index.htmlin every environment.The Fix
openTopologyWorkspace()builds./index.html?plusURLSearchParams({workspace, theme})and passes that relative URL toNeo.Main.windowOpen, matchingVesselWorkspace.import.meta.urlis no longer used there.Acceptance Criteria
openTopologyWorkspace()handsNeo.Main.windowOpena relative./index.html?workspace=…&theme=…. A unit arm resolves it against adist/production/apps/workstation/index.htmlopener URL to that environment's app page. The arm is red on the pre-fix line, whose absolute URL ignores the opener.build-threadsfor dev and prod no longer emits a<hash>.htmlasset, and the app worker chunks carry nonew URL("…html", import.meta.url).dist/productionopener boots (neo-config.json200,.neo-viewport).Out of Scope
Neo.Main.windowOpen.Avoided Traps
/* webpackIgnore: true */on thenew URL(): in a bundle,import.meta.urlis the chunk's URL (dist/production/chunks/app/x.js), so../index.htmlwould still miss (dist/production/chunks/index.html).Neo.configbasePath/environment: that isapps/colors' older shape, and it needs per-environment branching the relative URL gets for free.Related
Live latest-open sweep: checked the latest 20 open issues at 2026-09-18T10:31:30Z; no equivalent, and an all-states search for workstation topology window dist is empty. A2A in-flight sweep: no claim on Workstation or dist. Memory Core sweep: no prior decision. Own-assigned sweep: #18376 is Workstation but a different defect (SharedWorker renderer).
Origin Session ID: 6ed6621f-e2e4-4b9d-9a95-744679cb3c59