Context
Reported as a defect-note by @neo-fable-clio (2026-09-18), seen in neo-agent-institution at engine dev@70c2c94618, in framework and consumer build mode: dist/production/docs/index.html ends in Cannot find module './docs/app.mjs'.
The Problem
Neo.worker.App#importApp() (src/worker/App.mjs:388) loads every app through one lazy webpack context, filtered by:
/* webpackInclude: /(?:apps|docs\/app|examples|src)\/.*app\.mjs$/ */
The docs app's entry is docs/app.mjs: the folder docs/app/ holds its views, and the entry sits beside it. The alternation docs\/app followed by \/.*app\.mjs needs one more path segment, so the entry never matches. Webpack tests webpackInclude against the module's absolute path, not the ./ request (measured by @neo-opus-ada on 2026-03-27, when a ^\.\/ anchor emptied the context). Against absolute paths:
| Path |
Today |
Fixed |
<neo>/docs/app.mjs |
false |
true |
<neo>/apps/portal/app.mjs · <neo>/examples/button/base/app.mjs · <neo>/src/…/app.mjs |
true |
true |
<neo>/app.mjs |
false |
false |
<neo>/docs/app/…/app.mjs (no such file today) |
true |
true |
A context that does not include the entry has no chunk for it, so a bundled App worker cannot import the docs app. The unbundled development mode imports apps as native modules, where magic comments do nothing, which is why working on the docs locally shows nothing wrong.
Since when: #9517 (Standardize and optimize dynamic imports) replaced the include /(?:\/|\\)app.mjs$/, which matched any app.mjs, with the alternation.
The Architectural Reality
buildScripts/webpack/production/webpack.config.appworker.mjs:155 creates the Docs starting point whenever docs/app exists, and buildScripts/build/all.mjs:186 copies docs/output and docs/resources into dist/production/docs. The engine ships the docs app, and its entry cannot load.
- The include decides what a consumer's App worker may contain too, so the fix must stay as narrow as the alternation meant to be:
apps/**, examples/**, src/** app entries, plus the one docs entry.
The Fix
Add the docs entry and keep everything else the include matches: /(?:(?:apps|docs\/app|examples|src)\/.*|docs\/)app\.mjs$/. A unit arm pins it against the entries that must match and the paths that must not.
Acceptance Criteria
Out of Scope
- The
webpackExclude beside it.
- Consumer-mode reach of the engine's own apps (#18868's ticket body records it).
- Workspaces under an
apps/ ancestor match every app.mjs below it, today and after the fix. That is the ancestor-name class #17882 closed for the Data worker. It is also why PR #18872's guard, whose fixture sits under apps/, cannot witness this defect.
Related
#9517 (the change that narrowed the include) · #18868 / PR #18872 (the App-worker compile guard, which compiles and so cannot see a context that silently omits an entry) · neomjs/neo-agent-institution#153
Decision Record impact: none.
Sweeps: latest open issues at 13:44Z, and all-state searches for importApp webpackInclude and "docs/app.mjs": none equivalent. A2A, latest 30: @neo-fable-clio's defect-note (13:27Z) is the only mention, a capture rather than a claim. Memory Core on the include's nouns: @neo-opus-ada's 2026-03-27 finding that webpackInclude sees absolute paths, used above. Own assignments: none overlapping.
Origin Session ID: 0a997d38-ccdb-4352-ac21-566606a6ab2d
Retrieval Hint: "importApp webpackInclude docs/app.mjs absolute path production docs app Cannot find module"
Context
Reported as a defect-note by @neo-fable-clio (2026-09-18), seen in neo-agent-institution at engine
dev@70c2c94618, in framework and consumer build mode:dist/production/docs/index.htmlends inCannot find module './docs/app.mjs'.The Problem
Neo.worker.App#importApp()(src/worker/App.mjs:388) loads every app through one lazy webpack context, filtered by:The docs app's entry is
docs/app.mjs: the folderdocs/app/holds its views, and the entry sits beside it. The alternationdocs\/appfollowed by\/.*app\.mjsneeds one more path segment, so the entry never matches. Webpack testswebpackIncludeagainst the module's absolute path, not the./request (measured by @neo-opus-ada on 2026-03-27, when a^\.\/anchor emptied the context). Against absolute paths:<neo>/docs/app.mjs<neo>/apps/portal/app.mjs·<neo>/examples/button/base/app.mjs·<neo>/src/…/app.mjs<neo>/app.mjs<neo>/docs/app/…/app.mjs(no such file today)A context that does not include the entry has no chunk for it, so a bundled App worker cannot import the docs app. The unbundled development mode imports apps as native modules, where magic comments do nothing, which is why working on the docs locally shows nothing wrong.
Since when: #9517 (Standardize and optimize dynamic imports) replaced the include
/(?:\/|\\)app.mjs$/, which matched anyapp.mjs, with the alternation.The Architectural Reality
buildScripts/webpack/production/webpack.config.appworker.mjs:155creates theDocsstarting point wheneverdocs/appexists, andbuildScripts/build/all.mjs:186copiesdocs/outputanddocs/resourcesintodist/production/docs. The engine ships the docs app, and its entry cannot load.apps/**,examples/**,src/**app entries, plus the one docs entry.The Fix
Add the docs entry and keep everything else the include matches:
/(?:(?:apps|docs\/app|examples|src)\/.*|docs\/)app\.mjs$/. A unit arm pins it against the entries that must match and the paths that must not.Acceptance Criteria
src/worker/App.mjsand tests it against absolute paths, as webpack does.docs/app.mjs,apps/portal/app.mjs,examples/button/base/app.mjsand asrc/…/app.mjsmatch; a rootapp.mjsdoes not. It fails first ondev, on the docs entry.dist/production/docs/index.htmlwithoutCannot find module './docs/app.mjs'.Out of Scope
webpackExcludebeside it.apps/ancestor match everyapp.mjsbelow it, today and after the fix. That is the ancestor-name class #17882 closed for the Data worker. It is also why PR #18872's guard, whose fixture sits underapps/, cannot witness this defect.Related
#9517 (the change that narrowed the include) · #18868 / PR #18872 (the App-worker compile guard, which compiles and so cannot see a context that silently omits an entry) · neomjs/neo-agent-institution#153
Decision Record impact: none.
Sweeps: latest open issues at 13:44Z, and all-state searches for
importApp webpackIncludeand"docs/app.mjs": none equivalent. A2A, latest 30: @neo-fable-clio's defect-note (13:27Z) is the only mention, a capture rather than a claim. Memory Core on the include's nouns: @neo-opus-ada's 2026-03-27 finding thatwebpackIncludesees absolute paths, used above. Own assignments: none overlapping.Origin Session ID: 0a997d38-ccdb-4352-ac21-566606a6ab2d
Retrieval Hint: "importApp webpackInclude docs/app.mjs absolute path production docs app Cannot find module"