-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
i have problem to import mermaid from "mermaid" #5081
Comments
You're getting this error because mermaid is an ESM package, and you're trying to import into a CommonJS project. You can also refer these links for more info. |
@sidharthv96 sorry, but I get the same error on using cli
issues happens on installing mermaid-cli as dev dependency and running with |
@vvscode I'm not sure how close your error is related to mermaid. As the package is not mentioned in the stack trace. The CLI also doesn't |
does this make more clear, that the problem is somewhere there? =) UPD: tried to setup a demo repo and discovered that I'm not able to reproduce it in a fresh repo. Even when I take the same Sorry for noise UPD2: after removing yarn.lock the problem gone in my repo as well |
Hmmmmm, @vvscode, it looked like you somehow downloaded a version of It's good that you got the issue fixed, but if you do have any other issues with the CLI, please feel free to make an issue in https://github.com/mermaid-js/mermaid-cli :) |
Description
i cant use mermaid in my node js project, every time i want to import it , it give me an error
the error is:
Error [ERR_REQUIRE_ESM]: require() of ES Module C:**\Desktop\mermaid-js\node_modules\mermaid\dist\mermaid.core.mjs not supported.
Instead change the require of C:\Users\farya\Desktop\mermaid-js\node_modules\mermaid\dist\mermaid.core.mjs to a dynamic import() which is available in all CommonJS modules.
node version: 18.16.1
npm version: 9.5.1
Steps to reproduce
Screenshots
No response
Code Sample
Setup
Suggested Solutions
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: