emersonbottero/vitepress-plugin-mermaid

using withMermaid breaks dev server in vitepress alpha 35

Closed this issue · 3 comments

As title says, when you use withMermaid() in your config.js like this:

// .vitepress/config.js
import { withMermaid } from "vitepress-plugin-mermaid";

export default withMermaid({
  // your existing vitepress config...
});

and you run

npm run dev

you end up with an empty page and after some time (and 1530 requests) error in console:

Uncaught SyntaxError: ambiguous indirect export: default mermaid.core.mjs:7:7

with npm run build everything seems to work correctly

the problem is the mermaid version not the vitepress version.
see #24

OK, you are right and I can confirm that solution suggested in #24 (below) works... although I'd rather not have to use it

// docs/vite.config.ts or docs/vite.config.js
import { defineConfig } from "vite";

export default defineConfig({
  resolve: {
    alias: {
        "mermaid": "mermaid/dist/mermaid.esm.mjs",
    },
  },
});

fixed in #32