Skip to content

Commit

Permalink
Add new error text to recognize ESM-only imports
Browse files Browse the repository at this point in the history
This error message was added in Node.js 22.0.0:
npm/node@5f7fad2
  • Loading branch information
lpsinger authored and ryanblock committed Jan 17, 2025
1 parent 9b16951 commit f977673
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/config/pragmas/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ function resolve (path, cwd) {
}

let esmErrors = [
'require() cannot be used on an ESM graph with top-level await. Use import() instead.',
'Cannot use import statement outside a module',
`Unexpected token 'export'`,
'require() of ES Module',
Expand Down

0 comments on commit f977673

Please sign in to comment.