Skip to content

Commit f977673

Browse files
lpsingerryanblock
authored andcommitted
Add new error text to recognize ESM-only imports
This error message was added in Node.js 22.0.0: npm/node@5f7fad2
1 parent 9b16951 commit f977673

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/config/pragmas/plugins.js

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ function resolve (path, cwd) {
152152
}
153153

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

0 commit comments

Comments
 (0)