-
Hi! I'm attempting to use the Monaco Editor with JSON support in a Vite + React project, but I'm encountering an issue with loading the JSON worker. I've tried various things, none of which have worked. The thing I'm currently stuck at is I've gone around in circles a bit, and I've added the I was also getting issues earlier with accessing the I'd really appreciate any help which could point me in the right direction - I've created a minimal reproduction of the repo at https://github.com/dalyIsaac/monaco-react-json/. As an aside, I've created a custom language using Langium which I've got working with Monaco, so a big thanks to the work which has been done on this ecosystem! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
That's a known issue with vite, have a look at https://github.com/CodinGame/monaco-vscode-api/wiki/Troubleshooting#commonjs-dependencies |
Beta Was this translation helpful? Give feedback.
-
It's also supported by the standalone worker, just another way. You can refer to the monaco-editor documentation, you can do something like https://medium.com/@alanhe421/implementing-json-schema-based-intelligent-suggestions-in-monaco-editor-2f52e5856c35 |
Beta Was this translation helpful? Give feedback.
don't you have any error about
monaco-editor/esm/vs/language/json/json.worker?worker
? because that file doesn't exist 🤔 What you're looking for is probably@codingame/monaco-vscode-standalone-json-language-features/worker
🤔