Skip to content

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

@Mustafa-Aswadi

Description

@Mustafa-Aswadi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions