You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When implementing legacy module specifiers, we didn't throughly test the interaction when there weren't any other files next to the entry worker, and importing npm modules. It would create a Regex that matched _every_ import, and fail because a file of that name wasn't present in the source directory. This fix constructs a better regex, applies it only when there are more files next to the worker, and increases test coverage for that scenario.
Copy file name to clipboardExpand all lines: packages/wrangler/src/__tests__/publish.test.ts
+24
Original file line number
Diff line number
Diff line change
@@ -2362,6 +2362,30 @@ export default{
2362
2362
`"Deprecation warning: detected a legacy module import in \\"./index.js\\". This will stop working in the future. Replace references to \\"index.wasm\\" with \\"./index.wasm\\";"`
2363
2363
);
2364
2364
});
2365
+
2366
+
it("should not match regular module specifiers when there aren't any possible legacy module matches",async()=>{
2367
+
// see https://github.com/cloudflare/wrangler2/issues/655 for bug details
2368
+
2369
+
fs.writeFileSync(
2370
+
"./index.js",
2371
+
`import inner from './inner/index.js'; export default {};`
0 commit comments