fix(excalidraw): use import map to force React 18.3.1 for ALL modules including Excalidraw internals
CI / lint (push) Failing after 10s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / e2e (push) Has been skipped
CI / security (push) Successful in 23s
Desktop Build / build-windows (push) Has been cancelled
Desktop Build / build-linux (push) Has been cancelled

This commit is contained in:
2026-07-29 11:41:30 -04:00
parent 7d8fa18201
commit 8c665fb568
6 changed files with 104 additions and 13 deletions
+18 -4
View File
@@ -2,6 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Excalidraw Editor</title>
<style>
@@ -89,11 +92,22 @@
<button id="btn-export-svg" title="Export SVG">📐 SVG</button>
</div>
<!-- Import React, ReactDOM, and Excalidraw in a single module (order matters!) -->
<!-- Import map: force ALL modules (Excalidraw + sub-deps) to use React 18.3.1 -->
<script type="importmap">
{
"imports": {
"react": "https://esm.sh/[email protected]",
"react-dom": "https://esm.sh/[email protected]",
"react-dom/": "https://esm.sh/[email protected]/"
}
}
</script>
<!-- Single module script -->
<script type="module">
import React from "https://esm.sh/[email protected]";
import ReactDOM from "https://esm.sh/react-dom@18.3.1";
import * as ExcalidrawLib from "https://esm.sh/@excalidraw/[email protected]";
import React from "react";
import ReactDOM from "react-dom";
import * as ExcalidrawLib from "@excalidraw/[email protected]";
window.React = React;
window.ReactDOM = ReactDOM;