-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionAn error in the Docusaurus core causing instability or issues with its execution
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I'm using the latest version of Docusaurus.
- I have tried the
npm run clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages. - I have tried creating a repro with https://new.docusaurus.io.
- I have read the console error message carefully (if applicable).
Description
We get the below error when following the instructions here to implement Mermaid with Docusaurus 2.2
TypeError: Cannot read properties of undefined (reading 'mermaidAPI')
The error occurs when loading a page with a Mermaid diagram on it.
After some investigation it would appear that Mermaid 9.2 was released today and this caused the issue.
To resolve it, when added this to the package.json:
"mermaid": "9.1.1",
rather than
"mermaid": "^9.1.1",
I have reproduced the issue on a fresh site as well as our own
Reproducible demo
No response
Steps to reproduce
- Create new site of docusaurus
- add the Mermaid changes as per the documentation
- make a page with mermaid in them (add the ticks):
mermaid
graph LR
A[Build your site] --> B[Deploy your site]
- install npm packages
- start site
- navigate to page
Expected behavior
page loads
Actual behavior
page crashes with:
TypeError: Cannot read properties of undefined (reading 'mermaidAPI')
Your environment
- Docusaurus version used: 2.2.
- Environment name and version (e.g. Chrome 89, Node.js 16.4): Edge (106.0.1370.52 64bit); Node 16.15.0
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): Windows 10 21H2
Self-service
- I'd be willing to fix this bug myself.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugAn error in the Docusaurus core causing instability or issues with its executionAn error in the Docusaurus core causing instability or issues with its execution