Importing defaults doesn't work under ESM #1636
-
Hi there, I'm trying to import a module like this I put the This is the snippet of my {
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "src",
"declaration": false,
"downlevelIteration": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"importHelpers": true,
"lib": [
"es2020",
"dom"
],
"module": "es2020",
"moduleResolution": "node",
"outDir": "./dist",
"sourceMap": true,
"strict": true,
"target": "es2020",
} The I found this in the NodeJS documentation: https://nodejs.org/api/esm.html#esm_interoperability_with_commonjs |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You might be hitting this issue, copied from the nodejs documentation that you linked:
You are doing a wildcard import, but a default import. So that's the first thing I would test. |
Beta Was this translation helpful? Give feedback.
You might be hitting this issue, copied from the nodejs documentation that you linked:
You are doing a wildcard import, but a default import. So that's the first thing I would test.