Skip to content

Is this package pure ESM? getting "require() of ES Module not supported." error #63

Discussion options

You must be logged in to vote

Is this package "pure ESM"?

Yes, this package is published as ESM-only.

Do I have to convert my project to pure ESM to use it?

Absolutely not. Since you are using a bundler, you don't have to set "type": "module" in your project's package.json in order to use this library. All you need to do is to import this library instead of trying to require it. By the way, is there any particular reason you are using require() syntax in a Next.js project instead of import?

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@igordanchenko
Comment options

@igordanchenko
Comment options

@stonesthatwhisper
Comment options

@igordanchenko
Comment options

@stonesthatwhisper
Comment options

Answer selected by igordanchenko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants