Skip to content

Fix miniflare sourcemap warnings caused by references to files outside the package boundary#13613

Merged
petebacondarwin merged 1 commit intomainfrom
dario/13555/miniflare-external-sourcemaps
Apr 21, 2026
Merged

Fix miniflare sourcemap warnings caused by references to files outside the package boundary#13613
petebacondarwin merged 1 commit intomainfrom
dario/13555/miniflare-external-sourcemaps

Conversation

@dario-piotrowicz
Copy link
Copy Markdown
Member

Fixes #13555

miniflare's bundled sourcemap contained sources entries pointing into node_modules dependencies (zod, capnp-es, chokidar, etc.), which produced dozens of warnings in pnpm monorepos when tools like Vite or Vitest validated the sourcemaps at runtime. The build now inlines sourcesContent and patches any null entries left by upstream dependencies that don't publish their original source files

Warning

This solution significantly increase the Miniflare sourcemap file's size from 1.8MB to 6.0MB (bringing the total dist size from 10.9MB to ~15MB).
I think this is ok especially since Miniflare is a dev-dependency not used in production systems, but do let me know what you think.

This PR also fixes these types of warnings that we get in tests: https://github.com/cloudflare/workers-sdk/actions/runs/24677650006/job/72165992447?pr=13605#step:8:474


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: self explanatory DX improvement

A picture of a cute animal (not mandatory, but encouraged)

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 20, 2026

🦋 Changeset detected

Latest commit: 3cebe84

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented Apr 20, 2026

UnknownError: ProviderInitError

github run

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented Apr 20, 2026

@dario-piotrowicz Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

@dario-piotrowicz dario-piotrowicz force-pushed the dario/13555/miniflare-external-sourcemaps branch from 8bb1daa to 3cebe84 Compare April 20, 2026 23:12
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 20, 2026

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@13613

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@13613

miniflare

npm i https://pkg.pr.new/miniflare@13613

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@13613

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@13613

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@13613

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@13613

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@13613

wrangler

npm i https://pkg.pr.new/wrangler@13613

commit: 3cebe84

@dario-piotrowicz dario-piotrowicz marked this pull request as ready for review April 21, 2026 09:09
@workers-devprod workers-devprod requested review from a team and petebacondarwin and removed request for a team April 21, 2026 09:09
@workers-devprod
Copy link
Copy Markdown
Contributor

workers-devprod commented Apr 21, 2026

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

I've wanted this for so long!

Copy link
Copy Markdown
Contributor

@workers-devprod workers-devprod left a comment

Choose a reason for hiding this comment

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

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Apr 21, 2026
@petebacondarwin
Copy link
Copy Markdown
Contributor

@petebacondarwin petebacondarwin merged commit 2f3d7b9 into main Apr 21, 2026
66 of 68 checks passed
@petebacondarwin petebacondarwin deleted the dario/13555/miniflare-external-sourcemaps branch April 21, 2026 12:36
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Apr 21, 2026
@dario-piotrowicz
Copy link
Copy Markdown
Member Author

Could this approach fix these warnings too?

https://github.com/cloudflare/workers-sdk/actions/runs/24695116317/job/72284429437?pr=13613#step:7:947

Yes it does! 🙂

@dario-piotrowicz
Copy link
Copy Markdown
Member Author

Oh... I thought this PR would be much more controversial... thanks for the approval + merge @petebacondarwin 🫶

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

miniflare: sourcemap references sources outside its package boundary

3 participants