Skip to content

codeSplitters: Workers Logs traces still minified after the source-map release (#706) #799

Closed

Description

@QuinnsCode

Found while running #706 from #609 (11 Oct).

What happened: after the release at b7d2628 (which includes #708: minified Worker plus worker.sourceMaps), a harmless throw on live (POST /api/repos/quinn/pulsetest/branches with a non-JSON body, 500) shows up in Workers Logs with the minified stack, not the source:

SyntaxError: Unexpected token 'x', "x" is not valid JSON
  at async G5 (worker.js:695:2396)
  at async gAe (worker.js:869:790)
  at async Object.fetch (worker.js:869:8043)

Script version 4363dd6b-d8aa-4907-b629-fbd26f5f488c, ray a48f77c0097da9be, 2026-10-11 10:08:37 PDT. The expected frames are src/branches.ts:162 and src/worker.ts.

What I checked:

  • packages/cli/src/gen/alchemy.ts:144 adds a **/*.map rule when sourceMaps is set, and rustybuns.config.ts:65 sets it.
  • In alchemy 2.0.0-beta.77, Cloudflare/Workers/Sources/Prebuilt.js globs files by those rules and WorkerProvider.js (contentTypeFromExtension) sends .map as application/source-map. So the map should be one of the upload's parts.

Next: confirm the deployed version actually holds worker.js.map (dashboard → codesplitters → Edit code, or the Versions API's module list). If it does, compare the multipart part name and the //# sourceMappingURL= comment with what wrangler sends. Also check whether Cloudflare wants upload_source_maps in the metadata, or caps the map's size.

🤖 Generated with Claude Code

Activity

  1. self-assigned this
    on Oct 12, 2026
  2. QuinnsCode commented on Oct 12, 2026

    @QuinnsCode
    OwnerAuthor

    Looked into this from code (no deploy). The fix to try is in #802.

    • Upload parts are not the problem. Alchemy beta.77 sends worker.js (main_module) and worker.js.map as application/source-map, with part names taken from the file names. wrangler 4.149's upload_source_maps sends the same parts and adds no metadata flag.
    • The map is fine on size and link. It's 1.45 MB gzipped (the cap is 15 MB), //# sourceMappingURL=worker.js.map is the last line, and it resolves frames to src/*.ts locally.
    • Likely cause: the map's content. wrangler rewrites each map before upload: file becomes the module name and each source loses one leading ../. Bun's linked map has no file at all, and Alchemy uploads it byte-for-byte. rustybuns deploy: upload Worker source maps in wrangler's shape (#799) #802 makes rustybuns plan/deploy do wrangler's rewrite when worker.sourceMaps is on.
    • The codeSplitters: Workers Logs traces still minified after the source-map release (#706) #799 trace was an uncaught throw, so Cloudflare should have remapped it.

    Not confirmed: it needs the owner's next release and one uncaught error in Workers Logs. If that trace still points at worker.js, the rest of our side matches wrangler, so I'll file it upstream with Alchemy and Cloudflare.

    🤖 Generated with Claude Code

  3. QuinnsCode commented on Oct 12, 2026

    @QuinnsCode
    OwnerAuthor

    Update: the fix to try is #801, which is now on main. I closed #802 as a duplicate. It still needs the next release and one uncaught error in Workers Logs to confirm.

    🤖 Generated with Claude Code

  4. QuinnsCode commented on Oct 12, 2026

    @QuinnsCode
    OwnerAuthor

    Confirmed live, 12 Oct. After the release with #801 (Worker codesplitter, version 6ca8b0f9-5a49-4bd0-9fc4-7c4ec8269223), the same harmless throw (POST /api/repos/quinn/pulsetest/branches with body x) now logs:

    SyntaxError: Unexpected token 'x', "x" is not valid JSON
      at async kK (src/branches.ts:162:26)
      at async Nye (src/worker.ts:373:22)
      at async Object.fetch (src/worker.ts:559:25)
    

    The #706 box on #609 is ticked.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions