-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Labels
bugSomething that isn't workingSomething that isn't working
Description
Which Cloudflare product(s) does this pertain to?
Wrangler core
What version(s) of the tool(s) are you using?
3.14.0
What version of Node are you using?
v18.17.0
What operating system are you using?
Mac
Describe the Bug
Wrangler has started injecting some sort of "modules watch" code into production builds, when it shouldn't be. These functions are getting called for every import that is made in your worker script, which has an increase in both script size of ~5kb, and script startup time.
// wrangler-modules-watch:wrangler:modules-watch
var init_wrangler_modules_watch = __esm({
"wrangler-modules-watch:wrangler:modules-watch"() {
init_modules_watch_stub();
}
});
// node_modules/.pnpm/[email protected]/node_modules/wrangler/templates/modules-watch-stub.js
var init_modules_watch_stub = __esm({
"node_modules/.pnpm/[email protected]/node_modules/wrangler/templates/modules-watch-stub.js"() {
init_wrangler_modules_watch();
}
});
This behaviour started occurring in 3.11.0, and didn't occur in 3.10.0, so I'm almost certain it's the result of #3726, cc @petebacondarwin
Please provide a link to a minimal reproduction
Any worker that imports anything -> npx wrangler deploy --outdir dist, look at the outputted code to see these files which shouldn't be present
Please provide any relevant error logs
No response
Metadata
Metadata
Assignees
Labels
bugSomething that isn't workingSomething that isn't working
Type
Projects
Status
Done