bazingaedward / monaco-editor-vue3

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

Unexpected usage at EditorSimpleWorker #23

Open adamjimenez opened 11 months ago

adamjimenez commented 11 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 3 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