Skip to content
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

npm package for a node environment #4393

Closed
junka opened this issue May 13, 2023 · 0 comments
Closed

npm package for a node environment #4393

junka opened this issue May 13, 2023 · 0 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@junka
Copy link

junka commented May 13, 2023

Description

For a vscode plugin, use npm to install mermaid 10.1.0 as dependency.
import mermaid and compile pass.
running the program it compains

"failed: require() of ES Module /Users/admin/proj/github/xxx/node_modules/mermaid/dist/mermaid.core.mjs not supported. Instead change the require of /Users/admin/pxxx/node_modules/mermaid/dist/mermaid.core.mjs to a dynamic import() which is available in all CommonJS modules.."

Seems the package can only work in a browser environment ?

Steps to reproduce

prepare a vscode plugin project.

  1. npm i mermaid -D
  2. import mermaid from 'mermaid'
  3. running the plugin with F5

Screenshots

No response

Code Sample

No response

Setup

  • Mermaid version: 10.1.0
  • Node: v19.5.0

Additional Context

No response

@junka junka added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels May 13, 2023
@junka junka closed this as completed May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

1 participant