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
e.message=`Cannot determine intended module format because both require() and top-level await are present. If the code is intended to be CommonJS, wrap await in an async function. If the code is intended to be an ES module, replace require() with import.`;
86
+
letadvice;
87
+
switch(notDefinedGlobalLike){
88
+
case'require':
89
+
advice='replace require() with import';
90
+
break;
91
+
case'module':
92
+
case'exports':
93
+
advice='use export instead of module.exports/exports';
94
+
break;
95
+
case'__filename':
96
+
advice='use import.meta.filename instead';
97
+
break;
98
+
case'__dirname':
99
+
advice='use import.meta.dirname instead';
100
+
break;
101
+
}
102
+
103
+
e.message=`Cannot determine intended module format because both '${notDefinedGlobalLike}' and top-level await are present. If the code is intended to be CommonJS, wrap await in an async function. If the code is intended to be an ES module, ${advice}.`;
0 commit comments