Fix miniflare sourcemap warnings caused by references to files outside the package boundary#13613
Conversation
🦋 Changeset detectedLatest 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 |
|
UnknownError: ProviderInitError |
|
@dario-piotrowicz Bonk workflow failed. Check the logs for details. View workflow run · To retry, trigger Bonk again. |
…e the package boundary
8bb1daa to
3cebe84
Compare
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
|
Codeowners approval required for this PR:
Show detailed file reviewers |
petebacondarwin
left a comment
There was a problem hiding this comment.
I've wanted this for so long!
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
|
Could this approach fix these warnings too? |
Yes it does! 🙂 |
|
Oh... I thought this PR would be much more controversial... thanks for the approval + merge @petebacondarwin 🫶 |
Fixes #13555
miniflare's bundled sourcemap contained
sourcesentries pointing intonode_modulesdependencies (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 inlinessourcesContentand patches any null entries left by upstream dependencies that don't publish their original source filesWarning
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
A picture of a cute animal (not mandatory, but encouraged)