-
-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to use svgdom in Nestjs application but get require() of Es Module not supported Error. #121
Comments
same for me |
any solution yet? |
tsconfig.json try adding the following config "ts-node": {
"compilerOptions": {
"target": "es2015",
"module": "commonjs",
"moduleResolution": "nodenext"
}
} then const { createSVGWindow } = await import('svgdom') |
hey @l86110 this solution works for me! thank you so much, module option ask me to be set as "nodenext" same as moduleResolution but its working |
I used same solution, but i had other error
new error
some idea to solution |
I want to use svgdom into nest js application and get the below error
Error [ERR_REQUIRE_ESM]: require() of ES Module ..\..\node_modules\svgdom\main-module.js from ..\..\..\main.js not supported. Instead change the require of main-module.js in .\..\..\dist\apps\services\-\main.js to a dynamic import() which is available in all CommonJS modules.
I tested both ways to import the package but did not work.
The text was updated successfully, but these errors were encountered: