mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-29 22:17:13 +02:00
fix: move Prism global setup to entry-point module
The previous approach imported prismjs component files directly in MarkdownComposer.tsx. In Vite dev mode, each component is served as a separate ESM module whose IIFE references a bare 'Prism' global that doesn't exist yet, crashing the app. Fix: create a dedicated prismSetup module that imports prismjs and assigns globalThis.Prism, then import it from the renderer entry point (main.tsx) before any component that loads @lexical/code-prism. ESM evaluation order guarantees the global is set before the tokenizer captures its reference. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { StrictMode } from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
|
||||
import '@renderer/lib/prismSetup';
|
||||
import App from '@renderer/App';
|
||||
import '@renderer/styles.css';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user