diff options
Diffstat (limited to 'lib/internal/modules')
-rw-r--r-- | lib/internal/modules/cjs/loader.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index b09e3cceb5..a002efa175 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -97,7 +97,7 @@ function enrichCJSError(err) { usage. However, some cases are not matching, cases like import statement after a comment block and/or after a variable definition. */ - if (err.message.startsWith('Unexpected token export') || + if (err.message.startsWith('Unexpected token \'export\'') || (/^\s*import(?=[ {'"*])\s*(?![ (])/).test(lineWithErr)) { process.emitWarning( 'To load an ES module, set "type": "module" in the package.json or use ' + |