We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent da4a379 commit 89fda94Copy full SHA for 89fda94
lib/internal/modules/cjs/loader.js
@@ -648,9 +648,11 @@ Module.prototype.load = function(filename) {
648
// Create module entry at load time to snapshot exports correctly
649
const exports = this.exports;
650
if (module !== undefined) { // Called from cjs translator
651
- module.reflect.onReady((reflect) => {
652
- reflect.exports.default.set(exports);
653
- });
+ if (module.reflect) {
+ module.reflect.onReady((reflect) => {
+ reflect.exports.default.set(exports);
654
+ });
655
+ }
656
} else { // preemptively cache
657
ESMLoader.moduleMap.set(
658
url,
0 commit comments