mermaid-js/mermaid-cli

SyntaxError: The requested module `@mermaid-js/mermaid-cli` does not provide an export named 'run' (via SyntaxError)

pdaoust opened this issue · 1 comments

Describe the bug

It seems that the Node package doesn't export anything. Using the code example in the readme for using the Node.JS API, I just get errors like SyntaxError: The requested module @mermaid-js/mermaid-cli does not provide an export named 'run' (via SyntaxError). If I try to import the module's default export, I get an empty object.

To Reproduce
Steps to reproduce the behavior:

  1. Create a JavaScript file.
  2. Try to import any of the four exports provided in the Node.JS API
    import { run, renderMermaid } from "@mermaid-js/mermaid-cli";
  3. Try to run the file with Node.JS.
  4. Witness the aforementioned error.

Expected behavior

Availability of the five exports run, renderMermaid, cli, error, and the deprecated parseMMD when attempting to import @mermaid-js/mermaid-cli as an ES6 module.

Screenshots

image

Desktop:

  • OS: Ubuntu 23.10
  • Browser: n/a
  • Version: mermaid-cli v10.8.0

Smartphone:

n/a

Additional context

My project is set up as an ES6 module, and all other imports of other NPM and internal modules work fine. The project is an 11ty-based static site generator, and I think 11ty might insinuate itself into the module loading pipeline somehow.

I'm not entirely sure what i was doing wrong the other day... I bashed my head against this and then retried the statement that I thought I'd started out with, and... it works. Closing. 🤷🏼‍♂️