Closed VldMrgnn closed 1 year ago
Yea I've been wrestling with esm and cjs issues. Are you using typescript? I had to set moduleresolution to nodenext
Please see the tsconfig.json
below:
{
"compilerOptions": {
"target": "es5",
"downlevelIteration": true,
"lib": [
"dom",
"dom.iterable",
"esnext",
"es5",
"es2015.collection",
"es2015.iterable"
],
"baseUrl": ".",
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react",
"paths": {
"@app/*": ["src/*"]
},
},
"include": ["src", "index.d.ts", "custom.d.ts" ,"webpack.config.js"]
}
Can you try setting moduleResolution: "nodenext"
Setting moduleResolution: "nodenext"
fixes the issue, but in my case breaks some lazy imports and other CommonJs imports.
Okay, if you could downgrade to 4.x for now I'll push another fix shortly.
Of course. Please tell me if I can assist for testing or help otherwise.
I ended up reverting the build system and pushed a release. There's too many issues with ESM at this point.
I can confirm that 5.0.8. works as expected.
In version 5.0.3, the following import statement is no longer valid