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
{{ message }}
Repository navigation
miniflare: CommonJS resolution issues (conditional exports and require() from node_modules) #67
Miniflare returns {"default":{"which":"node.cjs"}}, and Node returns {"which":"node.mjs"}. Named imports then fail with does not provide an export named .... In Nitro this loads consola as lib/index.cjs.
2. require() inside a CommonJS file from node_modules resolves from the wrong location.
The CJS module's referrer is the importer's directory plus the file's basename. For example, node_modules/cjs-pkg/dist/index.cjs imported from src/deep/app.mjs gets the referrer src/deep/index.cjs?__cjs. Relative requires still work, but:
require("node:process") fails with No such module "node:process". The same builtin works with an ESM import.
When a plugin resolveId redirects the required id to a file (e.g. node:process → unenv/dist/runtime/node/process.mjs), that file's relative imports fail with Invalid module specifier "../../../_internal/utils.mjs". The same redirect works from an ESM import.
Activity
feat: support miniflare runner without a builder