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

docusaurus production build failing with mermaid #20

Closed
pete-the-pete opened this issue Dec 2, 2021 · 3 comments
Closed

docusaurus production build failing with mermaid #20

pete-the-pete opened this issue Dec 2, 2021 · 3 comments

Comments

@pete-the-pete
Copy link

Describe the bug
A clear and concise description of what the bug is.
docusaurus production build failing with mermaid

To Reproduce
Steps to reproduce the behaviour including how the markdown file is processed:

  1. include mermaid according to install steps
  2. add remarkPlugins: [require('mdx-mermaid')], to config for @docusaurus/plugin-content-docs
  3. create a digram in mardown
  4. yarn build in docusaurus
  5. 💥

Expected behavior
A clear and concise description of what you expected to happen.
Diagram should be rendered.

Screenshots
If applicable, add screenshots to help explain your problem.

Stack trace
If applicable, add the stack trace for the exception thrown to help trace your problem.

Docusaurus Node/SSR could not render static page with path "/docs/" because of following error:

ReferenceError: window is not defined
    at Object.61590 (main:79056:4)
    at __webpack_require__ (main:163201:42)
    at Object.43510 (main:79026:35)
    at __webpack_require__ (main:163201:42)
    at Module.54105 (main:17695:81)
    at __webpack_require__ (main:163201:42)
    at main:25925:56175

Pro tip: It looks like you are using code that should run on the client-side only.
To get around it, try using <BrowserOnly> (https://docusaurus.io/docs/docusaurus-core/#browseronly) or ExecutionEnvironment (https://docusaurus.io/docs/docusaurus-core/#executionenvironment).
It might also require to wrap your client code in useEffect hook and/or import a third-party library dynamically (if any).
Docusaurus Node/SSR could not render static page with path "/README" because of following error:

Error: Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=undefined&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at a.b.render (main:118082:32)
    at a.b.read (main:118078:83)
    at Object.exports.renderToString (main:118089:138)
    at doRender (main:26122:356)
    at async serverEntry_render (main:26121:294)



Error: Server-side rendering fails due to the error above.
Error: Server-side rendering fails due to the error above.
Unable to build website for locale "en".

● Client █████████████████████████ cache (99%) shutdown IdleFileCachePlugin
 serialize pack

● Server █████████████████████████ cache (99%) shutdown IdleFileCachePlugin
 serialize pack

Error: Failed to compile with errors.
    at node_modules/@docusaurus/core/lib/webpack/utils.js:203:24
    at node_modules/webpack/lib/MultiCompiler.js:554:14
    at processQueueWorker (node_modules/webpack/lib/MultiCompiler.js:491:6)
    at processTicksAndRejections (internal/process/task_queues.js:75:11)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1

Tool chain used:
What tool chain is used.
yarn, docusaurus, docusaurus/plugin-content-docs
Additional context
Add any other context about the problem here.

@pete-the-pete
Copy link
Author

This is an issue using mermaid < 8.11.

@sjwall
Copy link
Owner

sjwall commented Jan 9, 2022

Thank you for raising this, I have included it in the documentation to use a version >= 8.11.0

@PackElend
Copy link

can you tell me how to define the Mermaid version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants