mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
69k stars 6.11k forks source link

vite build failure for 10.9.0 #5362

Open jesse23 opened 4 months ago

jesse23 commented 4 months ago

Description

Vite build fails with vite-react-swc in 10.9.0

Steps to reproduce

  1. Mermaid Impl: https://github.com/jesse23/copilot/blob/mermaid_109_issue/apps/ui/src/components/MermaidDiagram.tsx
  2. Build config: https://github.com/jesse23/copilot/blob/mermaid_109_issue/apps/ui/vite.config.ts Result: npm run dev pass. npm run build & npm run preview will have error in browser as
    Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'prototype')
    at kS (index-a6050d12.js:564:23131)
    at index-a6050d12.js:564:26435
    at index-a6050d12.js:1608:2692

9.4 seems to be fine (yeah the API is slightly different with renderAsync

Screenshots

No response

Code Sample

No response

Setup

Suggested Solutions

No response

Additional Context

No response

sidharthv96 commented 4 months ago

Can you try v10.8.0 (to see if it's a issue with v10.9.0, or a difference between v9 and v10)?

And please provide a minimum reproduction, instead of a complete project.

jesse23 commented 4 months ago

Yeah I'll try to update before Monday. Thx!