fix(excalidraw): pin React 18.3.1 exact version (esm.sh was resolving to React 19)
CI / lint (push) Failing after 9s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / e2e (push) Has been skipped
CI / security (push) Successful in 13s
Desktop Build / build-windows (push) Has been cancelled
Desktop Build / build-linux (push) Has been cancelled
CI / lint (push) Failing after 9s
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / e2e (push) Has been skipped
CI / security (push) Successful in 13s
Desktop Build / build-windows (push) Has been cancelled
Desktop Build / build-linux (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head><meta charset="UTF-8"><title>Excalidraw Render Test</title>
|
||||
<style>
|
||||
body { font-family:monospace; background:#1e1e1e; color:#ddd; padding:20px; }
|
||||
.pass { color:#4caf50; } .fail { color:#f44336; }
|
||||
pre { background:#2d2d2d; padding:10px; border-radius:4px; }
|
||||
#app { margin-top:20px; border:1px dashed #555; min-height:100px; padding:10px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Excalidraw Render Diagnostic</h2>
|
||||
<pre id="log"></pre>
|
||||
<div id="app"></div>
|
||||
|
||||
<script type="module">
|
||||
import React from "https://esm.sh/react@18";
|
||||
import ReactDOM from "https://esm.sh/react-dom@18/client";
|
||||
const log = document.getElementById('log');
|
||||
function add(msg, cls='') { log.innerHTML += `<span class="${cls}">${msg}</span>\n`; }
|
||||
|
||||
add('--- Step 1: ReactDOM client ---');
|
||||
try {
|
||||
add(`✓ createRoot: ${typeof ReactDOM.createRoot}`, 'pass');
|
||||
} catch(e) {
|
||||
add(`✗ ${e.message}`, 'fail');
|
||||
}
|
||||
|
||||
add('\n--- Step 2: Testing basic React render ---');
|
||||
try {
|
||||
const root = ReactDOM.createRoot(document.getElementById('app'));
|
||||
root.render(React.createElement('div', null, 'Hello from React 18!'));
|
||||
add('✓ Basic React render OK', 'pass');
|
||||
} catch(e) {
|
||||
add(`✗ ${e.message}`, 'fail');
|
||||
}
|
||||
|
||||
add('\n--- Step 3: Loading Excalidraw ---');
|
||||
try {
|
||||
window.EXCALIDRAW_ASSET_PATH = 'https://esm.sh/@excalidraw/[email protected]/dist/prod/';
|
||||
const ExcalidrawLib = await import('https://esm.sh/@excalidraw/[email protected]');
|
||||
add(`✓ Excalidraw loaded`, 'pass');
|
||||
|
||||
const { Excalidraw } = ExcalidrawLib;
|
||||
add(` Excalidraw component type: ${typeof Excalidraw}`, 'info');
|
||||
|
||||
add('\n--- Step 4: Rendering Excalidraw ---');
|
||||
const root2 = ReactDOM.createRoot(document.getElementById('app'));
|
||||
try {
|
||||
root2.render(
|
||||
React.createElement(Excalidraw, {
|
||||
initialData: {
|
||||
elements: [],
|
||||
appState: { viewBackgroundColor: '#ffffff' },
|
||||
files: {}
|
||||
},
|
||||
theme: 'dark',
|
||||
excalidrawRef: (api) => {
|
||||
add('✓ excalidrawRef CALLBACK FIRED! Excalidraw is mounted!', 'pass');
|
||||
}
|
||||
})
|
||||
);
|
||||
add(' render() called - waiting for excalidrawRef callback...', 'info');
|
||||
} catch(e) {
|
||||
add(`✗ RENDER ERROR: ${e.message}`, 'fail');
|
||||
add(` Stack: ${e.stack}`, 'info');
|
||||
}
|
||||
} catch(e) {
|
||||
add(`✗ ${e.message}`, 'fail');
|
||||
add(` Stack: ${e.stack}`, 'info');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user