Skip to content

Have this error (Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/oluwasetemi/Development/projects/contractors/groovy/groovy_backend/node_modules/remark/index.js require() of ES modules is not supported.) using remark with typescript #803

Discussion options

You must be logged in to vote

The issue is coming from the tsconfig.json, see https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#im-having-problems-with-esm-and-typescript

If you have decided to make your project ESM ("type": "module" in your package.json), make sure you have "module": "ES2020" in your tsconfig.json and that all your import statements to local files use the .js extension, not .ts or no extension.

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
9 replies
@Oluwasetemi
Comment options

@ChristianMurphy
Comment options

@sodhisaab
Comment options

@ChristianMurphy
Comment options

@sodhisaab
Comment options

Answer selected by ChristianMurphy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
🏗 area/tools This affects tooling
3 participants