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-clidoes 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:
Create a JavaScript file.
Try to import any of the four exports provided in the Node.JS API
import { run, renderMermaid } from "@mermaid-js/mermaid-cli";
Try to run the file with Node.JS.
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
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. 🤷🏼♂️
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-clidoes 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:
Expected behavior
Availability of the five exports
run
,renderMermaid
,cli
,error
, and the deprecatedparseMMD
when attempting to import@mermaid-js/mermaid-cli
as an ES6 module.Screenshots
Desktop:
mermaid-cli
v10.8.0Smartphone:
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.