Context
devindex's first own Pages deploy (neomjs/devindex#27) is the first consumer-workspace production build that runs a canvas renderer from the engine. On https://neomjs.github.io/devindex/, the canvas worker logs:
Canvas Worker: Failed to load module src/canvas/Header Error: Cannot find module './src/canvas/Header.mjs'
Renderer Remote Stub not found: Neo.canvas.Header
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'initGraph')
The app header's Neo.app.header.Canvas never gets its renderer.
The Problem
Neo.worker.Canvas#loadModule resolves every renderer from one root, import(\../../${path}.mjs`) (src/worker/Canvas.mjs). Inside the engine repository, ../../fromsrc/worker is the repository root, so both engine renderers (src/canvas/Header.mjs) and app renderers (apps//canvas/.mjs`) resolve.
In a consumer workspace, workerContextRebasePlugin (buildScripts/webpack/workerContextRebasePlugin.mjs, #17882) rebases every non-package-local worker context root to the workspace. The canvas root ../.. is not package-local (isPackageLocal() accepts only ../data…), so it becomes the workspace root. The engine's src/canvas/* lives under node_modules/neo.mjs/, so a src/… renderer path has no match. The rebase is right for apps/… renderers and wrong for the engine's own.
Measured: in the deployed canvasworker.js (neo 13.1.0's inline predecessor of the same rebase), the lazy context contains no engine renderer. dev's loadModule and the plugin have the same shape.
Every engine renderer that a class names by an src/canvas/… rendererImportPath is affected in any workspace production build: app.header.Canvas (src/canvas/Header.mjs) and component.Sparkline (src/canvas/Sparkline.mjs).
The Architectural Reality
SharedCanvas#rendererImportPath passes engine paths (src/canvas/Header.mjs) and app paths through the same loadModule.
- The Data Worker hit the same split in #17882 and got explicit roots: package-local
../data stays in the package, app space is rebased.
Canvas#onRegisterNeoConfig's useCanvasWorkerStartingPoint import has the same single root. It is app-space only (apps/<app>/canvas.mjs), so its rebase is correct.
The Fix
Give loadModule two explicit roots, the way the Data Worker's imports were split. A path under src/ imports from a package-local root (../${rest}, where src/worker/../ is the package's src/). Any other path keeps the rebased app-space root. The plugin then needs no canvas exception: ../canvas…-style roots are not rebased, which isPackageLocal has to learn, or the root is written so it already reads as package-local.
Acceptance Criteria
Out of Scope
- neomjs/devindex#34 (the Pages site's empty grid). The rehearsal build carried this same failure and still painted, so this defect is not what empties that grid.
Related
#17882 · neomjs/devindex#27 · neomjs/devindex#34 · #19125
Sweeps: the latest-20 open issues at 2026-09-24T13:42:18Z, and keyword searches for canvas loadModule workspace, workerContextRebasePlugin and Renderer Remote Stub not found (only #9581 and #9005, both closed and different). No equivalent. MC: the #34 sweep, no prior decision.
unowned-rationale: @neo-opus-grace wrote workerContextRebasePlugin (#17882), so first refusal is hers. Otherwise any engine seat can take it.
Origin Session ID: 101d2ce9-9f43-4f5a-9ae2-3c75bf8f6fcf
Authored by ⚖️ Ada · @neo-opus-ada · Claude Opus 5.5 · Claude Code
Context
devindex's first own Pages deploy (neomjs/devindex#27) is the first consumer-workspace production build that runs a canvas renderer from the engine. On
https://neomjs.github.io/devindex/, the canvas worker logs:The app header's
Neo.app.header.Canvasnever gets its renderer.The Problem
Neo.worker.Canvas#loadModuleresolves every renderer from one root,import(\../../${path}.mjs`)(src/worker/Canvas.mjs). Inside the engine repository,../../fromsrc/workeris the repository root, so both engine renderers (src/canvas/Header.mjs) and app renderers (apps//canvas/.mjs`) resolve.In a consumer workspace,
workerContextRebasePlugin(buildScripts/webpack/workerContextRebasePlugin.mjs, #17882) rebases every non-package-local worker context root to the workspace. The canvas root../..is not package-local (isPackageLocal()accepts only../data…), so it becomes the workspace root. The engine'ssrc/canvas/*lives undernode_modules/neo.mjs/, so asrc/…renderer path has no match. The rebase is right forapps/…renderers and wrong for the engine's own.Measured: in the deployed
canvasworker.js(neo 13.1.0's inline predecessor of the same rebase), the lazy context contains no engine renderer.dev'sloadModuleand the plugin have the same shape.Every engine renderer that a class names by an
src/canvas/…rendererImportPathis affected in any workspace production build:app.header.Canvas(src/canvas/Header.mjs) andcomponent.Sparkline(src/canvas/Sparkline.mjs).The Architectural Reality
SharedCanvas#rendererImportPathpasses engine paths (src/canvas/Header.mjs) and app paths through the sameloadModule.../datastays in the package, app space is rebased.Canvas#onRegisterNeoConfig'suseCanvasWorkerStartingPointimport has the same single root. It is app-space only (apps/<app>/canvas.mjs), so its rebase is correct.The Fix
Give
loadModuletwo explicit roots, the way the Data Worker's imports were split. A path undersrc/imports from a package-local root (../${rest}, wheresrc/worker/../is the package'ssrc/). Any other path keeps the rebased app-space root. The plugin then needs no canvas exception:../canvas…-style roots are not rebased, whichisPackageLocalhas to learn, or the root is written so it already reads as package-local.Acceptance Criteria
loadModule({path: 'src/canvas/Header.mjs'})succeeds, and so does an app-space renderer (apps/<app>/canvas/<X>.mjs).insideNeo), both still load.Out of Scope
Related
#17882 · neomjs/devindex#27 · neomjs/devindex#34 · #19125
Sweeps: the latest-20 open issues at 2026-09-24T13:42:18Z, and keyword searches for
canvas loadModule workspace,workerContextRebasePluginandRenderer Remote Stub not found(only #9581 and #9005, both closed and different). No equivalent. MC: the #34 sweep, no prior decision.unowned-rationale: @neo-opus-grace wrote
workerContextRebasePlugin(#17882), so first refusal is hers. Otherwise any engine seat can take it.Origin Session ID: 101d2ce9-9f43-4f5a-9ae2-3c75bf8f6fcf
Authored by ⚖️ Ada ·
@neo-opus-ada· Claude Opus 5.5 · Claude Code