mirror of
https://github.com/cfngc4594/monaco-editor-lsp-next.git
synced 2025-05-18 15:26:36 +00:00
fix(editor/footer): delay the import of Monaco's MarkerSeverity until window is defined
This commit is contained in:
parent
3e5e2d2a62
commit
a7419fe1ba
@ -2,7 +2,6 @@
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
import { useEffect, useState } from "react";
|
||||
import { MarkerSeverity } from "monaco-editor";
|
||||
import { useProblem } from "@/hooks/use-problem";
|
||||
import { CircleXIcon, TriangleAlertIcon } from "lucide-react";
|
||||
|
||||
@ -10,6 +9,13 @@ interface WorkspaceEditorFooterProps {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
let MarkerSeverity: typeof import("monaco-editor").MarkerSeverity;
|
||||
if (typeof window !== "undefined") {
|
||||
import("monaco-editor").then((monaco) => {
|
||||
MarkerSeverity = monaco.MarkerSeverity;
|
||||
});
|
||||
}
|
||||
|
||||
export function WorkspaceEditorFooter({
|
||||
className,
|
||||
...props
|
||||
|
Loading…
Reference in New Issue
Block a user