Skip to content

theme-mermaid: layout-elk is not really an optional dependency #11430

@gylxan

Description

@gylxan

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and 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

Hi guys!

Since this morning we get the following error, when we try to run docusaurus build.

[cause]: Error: Failed to compile due to Webpack errors.
× Module not found: Can't resolve '@mermaid-js/layout-elk' in '/Users/gylxan/docusaurus-project/node_modules/.pnpm/@docusaurus+theme-mermaid@3.9.0_@docusaurus+faster@3.9.0_@docusaurus+types@3.9.0_@swc+c_58aaeca4b2b6f99a4ff81e7112e57ee4/node_modules/@docusaurus/theme-mermaid/lib/client'
╭─[139:24]
137 │                     return [
138 │                         4,
139 │                         import('@mermaid-js/layout-elk')
·                         ────────────────────────────────
140 │                     ];
141 │                 case 1:
╰────

I think this belongs to #11357.

We are using docusaurus with the experimental_faster future flag.

Any idea what is the problem here?

Reproducible demo

No response

Trying currently to build a codesandbox to show the error

Steps to reproduce

  1. Configure future flag experimental_faster: true
  2. Install @docusarus/faster and @docusaurus/theme-mermaid
  3. Build docusaurus with docusaurus build

Expected behavior

Resolving the named optional dependency, which is not installed, should not lead to a failing build

Actual behavior

Resolving the optional dependency, which is not installed, leads to a failing build

Your environment

Self-service

  • I'd be willing to fix this bug myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its execution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions