Mermaid diagrams causing CSP errors due to dynamic chunk loading #3680
Labels
bug
Something isn't working
enhancement
New feature or request
Issue - Unassigned / Actionable
Clear and approved. Available for contributors to pick up.
Problem
When rendering Mermaid diagrams in the webview, CSP errors are occurring because Mermaid is attempting to dynamically load chunks from the webview's origin. This results in errors like:
Root Cause
Mermaid v11.4.1 is dynamically loading chunks at runtime, but these requests are being blocked by the webview's Content Security Policy because they're trying to load from the webview origin rather than through the vscode-webview-resource scheme.
Proposed Solution
Implement an enhanced bundling strategy in Vite that:
This approach should prevent Mermaid from attempting to load any chunks dynamically at runtime from the webview origin.
The text was updated successfully, but these errors were encountered: