From 1c4d850441df5282be56291ac035d52fb43a95c2 Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Mon, 18 May 2026 19:40:10 -0300 Subject: [PATCH] fix(build): import Monaco ESM API to fix webpack nls.messages-loader error Replace import("monaco-editor") with import("monaco-editor/esm/vs/editor/editor.api") in MonacoEditor.tsx. The root package entry resolves to the minified bundle (min/vs/editor/editor.main.js) which requires the monaco-editor-webpack-plugin loader "vs/nls.messages-loader". The ESM API module has no such dependency and satisfies loader.config({ monaco }) identically. --- src/shared/components/MonacoEditor.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/components/MonacoEditor.tsx b/src/shared/components/MonacoEditor.tsx index e2026f35e3..11f601f82f 100644 --- a/src/shared/components/MonacoEditor.tsx +++ b/src/shared/components/MonacoEditor.tsx @@ -11,7 +11,7 @@ const MonacoEditor = dynamic( async () => { const [{ default: Editor, loader }, monaco] = await Promise.all([ import("@monaco-editor/react"), - import("monaco-editor"), + import("monaco-editor/esm/vs/editor/editor.api"), ]); loader.config({ monaco }); return Editor;