bazingaedward / monaco-editor-vue3

Monaco Editor for Vue3
MIT License
89 stars 17 forks source link

Unexpected usage at EditorSimpleWorker #23

Open adamjimenez opened 10 months ago

adamjimenez commented 10 months ago

I get this error in the console. It still works however..

Error: Unexpected usage at EditorSimpleWorker.loadForeignModule (webpack-internal:///./node_modules/monaco-editor-vue3/node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.js:480:31) at eval (webpack-internal:///./node_modules/monaco-editor-vue3/node_modules/monaco-editor/esm/vs/editor/browser/services/webWorker.js:44:30) Error: Unexpected usage

Zetaphor commented 2 months ago

This error implies you're trying to use a language type that you haven't loaded the service worker for.

For example if I try and use JS, but I haven't loaded the JS/TS worker:

import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';

I would get the same error