We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e849c3 commit 819a647Copy full SHA for 819a647
lib/internal/modules/cjs/loader.js
@@ -661,9 +661,11 @@ Module.prototype.load = function(filename) {
661
// create module entry at load time to snapshot exports correctly
662
const exports = this.exports;
663
if (module !== undefined) { // called from cjs translator
664
- module.reflect.onReady((reflect) => {
665
- reflect.exports.default.set(exports);
666
- });
+ if (module.reflect) {
+ module.reflect.onReady((reflect) => {
+ reflect.exports.default.set(exports);
667
+ });
668
+ }
669
} else { // preemptively cache
670
ESMLoader.moduleMap.set(
671
url,
0 commit comments