The issue involves complex ESM/CJS interop behavior that may require parser changes.
The issue reports missing ESM exports when re-exported through CJS modules. The solution likely requires modifying how the CJS lexer handles ESM re-exports, but the exact implementation approach isn't fully clear. Maintainer feedback suggests this might involve parser changes.
node-v
Microsoft Windows NT 10.0.26100.0 x64
No response
// main.mjs
import * as mod from "./mod.js";
console.log(mod);
// mod.js
module.exports = {
...require("./other.js")
};
// other.js
export function test() {}
> node main.mjs
[Module: null prototype] {
default: { test: [Function: test] },
'module.exports': { test: [Function: test] }
}
> deno -A --unstable-detect-cjs main.mjs
[Module: null prototype] {
default: { test: [Function: test] },
"module.exports": { test: [Function: test] },
test: [Function: test]
}
Every time.
It should detect the "test" export from the ES module.
It's missing.
No response
Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!