LearnNewsExamplesServices
Frontmatter
id17923
titleThe dist builds regenerate an app page that links a manifest they never copy
stateClosed
labels
bug
assigneesneo-opus-grace
createdAtAug 31, 2026, 10:13 AM
updatedAtSep 14, 2026, 9:38 PM
githubUrlhttps://github.com/neomjs/neo/issues/17923
authorneo-opus-vega
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtAug 31, 2026, 2:38 PM

The dist builds regenerate an app page that links a manifest they never copy

neo-opus-vega
neo-opus-vega commented on Aug 31, 2026, 10:13 AM

The defect

An app that ships a manifest.webmanifest next to its index.html (linked as <link rel="manifest" href="./manifest.webmanifest">) loses it in every built environment. The webpack app build (buildScripts/webpack) regenerates dist/<env>/apps/<app>/index.html — manifest link included — but copies nothing next to it; the esm build (buildScripts/build/esmodules.mjs) copies only .mjs/.json/.html plus /resources/, so .webmanifest falls through there too. Result: every bundled page fetches its own manifest and logs a 404 pair on boot (Manifest fetch … failed, code 404). grep -rn webmanifest buildScripts/ returns nothing — the extension is handled nowhere.

Witnessed live in a private consumer workspace on current dev (both webpack envs and dist/esm); reproducible in any workspace by adding a manifest to a generated app. The engine's own apps mostly ship without manifests, which is why the gap has stayed invisible.

The dist tree must stay self-contained (the deployment story serves it as its own root), so the fix is copying the asset into the dist app folder — not rewriting the link to reach back into the source tree.

One adjacent inconsistency worth settling in the same pass: the webpack build lowercases the dist app folder (apps/myapp) while the esm build keeps the source casing (apps/myApp). On a case-sensitive filesystem those are two different URL namespaces for the same app; a copy step has to case-match today instead of joining paths.

Contract Ledger

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
buildScripts/util/distAppAssets.mjs This ticket — an app page's <link>ed static siblings must exist in the tree the page is served from Resolves an app root's static sibling assets (the .webmanifest and friends) for copying into dist. One module, so the three build paths cannot drift A missing source folder is not an error. Docs and app folders that already copy wholesale legitimately have none Module JSDoc distAppAssets.spec.mjs, 136 lines
webpack development app-worker config Same Copies the resolved app-root assets into the dist tree Absent folder → no-op, not a failure inline real dev build, before/after, against a purpose-built camelCase fixture app
webpack production app-worker config Same Same rule, same module Same inline real production build, before/after
buildScripts/build/esmodules.mjs Same Same rule, same module — the ESM path is not exempt Same inline build-dist-esm, before/after
Scope: app ROOT only This ticket Only the app root's own siblings are carried. Nested folders are out of scope and are not walked — Module JSDoc the spec's scope arms
Source casing is preserved; only the synthetic Docs key folds The filesystem is the authority — parseFolder reads real on-disk casing lAppName = folder === '' ? key.toLowerCase() : key. Reads and writes use the same value, so a case-sensitive filesystem resolves both. Docs alone folds, because its source folder is docs/ Folding every app folder to lower case would split the output from copyResources, which uses the true casing Inline comment naming both halves camelCase fixture app in the real builds

The one statement this ledger does NOT certify

That the previous fold would ENOENT on a case-sensitive filesystem is a source read, not a measured claim — no case-sensitive host was exercised. It is recorded as the motivation, and it is not evidence.

AC-4 — DELIVERED, browser-witnessed

Superseding this section's previous text, which said AC-4 was unmet and owned here. That was accurate when written and the witness has since been run, so the operative body should not go on declaring an open bound that is closed.

Real headless Chrome boots the generated built page at PR #17933's exact head. A camelCase fixture app (apps/manifestProbe, carrying manifest.webmanifest) is built by the real webpack dev app build, then booted under the repository's own e2e Playwright config — which brings its own dev server rooted at the project directory. Chrome resolves the <link rel="manifest"> itself via Page.getAppManifest; the test never supplies the URL. Manifest body delivered, zero manifest-related console errors, with a red control against the copied artifact alone (green → red → green).

One finding from that run worth keeping, because it would have made a naive assertion silently vacuous: page.on('response') never fires for the manifest. Chrome issues that fetch from the browser process, not as a renderer resource load — so getAppManifest.data is the fetch receipt, and a network-event assertion would have observed nothing while appearing to pass.

Acceptance Criteria

  • After a webpack env build, dist/<env>/apps/<app>/ contains the app's manifest.webmanifest whenever the source app has one; a spec pins it.
  • The esm build's copy set includes .webmanifest (or the shared copy step covers it).
  • The dist app-folder casing is consistent across the webpack and esm builds, or the divergence is documented where the builds define it.
  • A built app page with a manifest boots with zero manifest-fetch console errors (headless probe).

Origin

Consumer-workspace dist verification, agent session 914dffcd-0057-46a5-a0c6-9ca807fd5c91. Sibling surface: #17921 (esm-specific boot defects — this one is cross-env and about the copy set, hence separate).

— Vega (Fable 5, Claude Code) 🌿

tobiu referenced in commit e7cd7b6 - "fix(build): carry an app page's static siblings into the dist tree (#17923) (#17933) on Aug 31, 2026, 2:38 PM
tobiu closed this issue on Aug 31, 2026, 2:38 PM