Skip to content

Transpile src for the website and node builds too - #4

Merged
Mistium merged 1 commit into
masterfrom
fix/website-babel-parse
Sep 21, 2026
Merged

Mistium merged 1 commit into
masterfrom
fix/website-babel-parse

Conversation

@Mistium

@Mistium Mistium commented Sep 21, 2026

Copy link
Copy Markdown
Member

The Build workflow has failed on master since 2026-09-08 with:

ERROR in ./src/packager/packager.js 1235:30
Module parse failed: Unexpected token (1235:30)
 @ ./src/p4/Downloads.svelte 26:0-48 199:23-31

src/packager/packager.js uses ?? in the CSP meta template, and webpack 4's
parser predates nullish coalescing. Only makeScaffolding configured
babel-loader — makeWebsite had just the png/svg and svelte rules, so the
module that reaches packager.js through src/p4/Downloads.svelte was parsed
raw.

Changes

  • The babel rule is extracted into a shared makeJavascriptRule(), unchanged
    from the one makeScaffolding already used.
  • makeWebsite gets the rule. This is the failure CI hits.
  • makeNode gets it too. It has the same gap and the same entry path into
    packager.js via src/packager/node/export.js, so it would break the same
    way; it only runs under BUILD_MODE=node, which CI does not exercise.

Testing

All three steps the Build workflow runs, locally on Node 24:

  • npm run build — succeeds (fails on master in the same checkout)
  • npm test — 16 suites, 48 passed, 1 skipped
  • npm run build-standalone-prod — succeeds, emits dist/standalone.html

This unblocks #1, whose red build check is this failure
inherited from master rather than anything in that change.

webpack 4's parser predates nullish coalescing, and
src/packager/packager.js uses it in the CSP meta template. Only
makeScaffolding configured babel-loader, so makeWebsite -- which reaches
packager.js through src/p4/Downloads.svelte -- parsed it raw and died with
"Module parse failed: Unexpected token (1235:30)". master has been red
since 2026-09-08 for this reason.

The rule is now a shared makeJavascriptRule() used by all three configs.
makeNode had the same gap and the same entry path into packager.js, so it
gets the rule as well; it only runs under BUILD_MODE=node, which CI does
not exercise.

All three CI steps pass locally: npm run build, npm test (16 suites, 48
passed) and npm run build-standalone-prod.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying packagermistwarp with  Cloudflare Pages  Cloudflare Pages

Latest commit: cedc14f
Status: ✅  Deploy successful!
Preview URL: https://d56b39d9.packagermistwarp.pages.dev
Branch Preview URL: https://fix-website-babel-parse.packagermistwarp.pages.dev

View logs

@Mistium
Mistium merged commit 775f179 into master Sep 21, 2026
2 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.

1 participant