svgdom icon indicating copy to clipboard operation
svgdom copied to clipboard

Trying to use svgdom in Nestjs application but get require() of Es Module not supported Error.

Open Mustafa-Aswadi opened this issue 11 months ago • 5 comments

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.

Mustafa-Aswadi avatar Mar 11 '24 08:03 Mustafa-Aswadi