ESM re-exports from CJS module not included in exports
Offen
Dieses Issue hat noch niemand übernommen.
loaders
- Vorherrschende Sprache
- JavaScript
- Sterne
- 122k
- Forks
- 37.3k
- Ø Merge
- 4 T. 2 Std.
- Gemergte PRs (30 T.)
- 283
Beschreibung
Version
node-v
Platform
Microsoft Windows NT 10.0.26100.0 x64
Subsystem
No response
What steps will reproduce the bug?
// 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]
}
How often does it reproduce? Is there a required condition?
Every time.
What is the expected behavior? Why is that the expected behavior?
It should detect the "test" export from the ES module.
What do you see instead?
It's missing.
Additional information
No response
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere das Problem mit main.mjs, mod.js und other.js unter Verwendung von node main.mjs und vergleiche anschließend Nodes Namespace-Ausgabe mit dem Deno-Beispiel. Verfolge die Erkennung von CommonJS-to-ESM-Exports durch Node und überprüfe, dass der Test-Export aus other.js im Namespace enthalten ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, nodejs
- Bereich
- backend
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 48/100