Skip to content

Fix page build regression from service worker WASM asset injection - #103

Merged
scaryrawr merged 2 commits into
mainfrom
copilot/fix-website-bug-validation
Apr 1, 2026
Merged

Fix page build regression from service worker WASM asset injection#103
scaryrawr merged 2 commits into
mainfrom
copilot/fix-website-bug-validation

Conversation

Copilot AI commented Apr 1, 2026

Copy link
Copy Markdown

The last web change broke the website by producing an invalid generated service worker during the page build. The breakage came from the asset cache list no longer remaining syntactically valid after the build step injected the hashed WASM filename.

  • Service worker asset list

    • Add the missing trailing comma before the build-time WASM_PLACEHOLDER in apps/page/src/service-worker.ts
    • This preserves a valid ASSETS_TO_CACHE array after apps/page/build.ts injects the generated .wasm asset
  • Regression coverage

    • Add a focused test in apps/page/src/service-worker-build.test.ts
    • The test replaces the placeholder the same way the build does and asserts the generated asset list keeps both entries correctly separated
  • What this affects

    • Restores successful page/service worker generation for the website
    • Prevents future offline-support edits from silently breaking the generated service worker
const ASSETS_TO_CACHE = [
  `${BASE_PATH}/manifest.json`,
  // WASM_PLACEHOLDER - will be replaced at build time
];
Original prompt

Last commit broke the website. Fox and validate

Agent-Logs-Url: https://github.com/scaryrawr/sl/sessions/bc1a3f14-013c-480a-9a0c-5af5d31dc970

Co-authored-by: scaryrawr <661373+scaryrawr@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix and validate website after last commit Fix page build regression from service worker WASM asset injection Apr 1, 2026
Copilot AI requested a review from scaryrawr April 1, 2026 02:30
@scaryrawr
scaryrawr marked this pull request as ready for review April 1, 2026 02:59
Copilot AI review requested due to automatic review settings April 1, 2026 02:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a regression in the apps/page build pipeline where apps/page/build.ts injects a WASM asset into the service worker asset cache list, and the generated service worker became syntactically invalid.

Changes:

  • Add a trailing comma to the manifest.json entry in ASSETS_TO_CACHE so build-time WASM injection preserves valid array syntax.
  • Add a Bun test that simulates the build-time placeholder replacement and asserts the resulting asset list remains correctly comma-separated.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
apps/page/src/service-worker.ts Ensures ASSETS_TO_CACHE stays syntactically valid after build-time WASM asset injection.
apps/page/src/service-worker-build.test.ts Adds regression coverage for the placeholder replacement behavior used by apps/page/build.ts.

@scaryrawr
scaryrawr merged commit 706cead into main Apr 1, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants