-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Labels
investigateUnder investigation and may be a bug.Under investigation and may be a bug.v6Issues regarding v6Issues regarding v6
Description
Ethers Version
6.15.0
Search Terms
No response
Describe the Problem
Lines 38 to 39 in 9fd9d41
"import": "./lib.esm/index.js", | |
"default": "./lib.commonjs/index.js" |
Running Node.js v20.18.0, when you import
a file that ends in .js
, and the nearest package.json doesn't say type: "module" (and the package.json in ethers doesn't), it gets parsed as CommonJS.
So it just chokes with a SyntaxError when it sees ESM syntax.
Either ESM files have to end in .mjs
, or "type"
has to be added to package.json and all CommonJS files have to end in .cjs
.
Code Snippet
`import ethers from 'ethers'`
Contract ABI
Errors
Environment
No response
Environment (Other)
No response
Metadata
Metadata
Assignees
Labels
investigateUnder investigation and may be a bug.Under investigation and may be a bug.v6Issues regarding v6Issues regarding v6