Error with @svuick/monaco on Vite
> pybox@0.0.0 dev /home/matteo/Coding/pybox
> vite
VITE v4.2.0 ready in 233 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h to show help
✘ [ERROR] Could not read from file: /home/matteo/Coding/pybox/node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/language/json/json.worker.js?worker
node_modules/.pnpm/@svuick+monaco@0.0.3/node_modules/@svuick/monaco/monaco/index.js:7:23:
7 │ ... => import('monaco-editor/esm/vs/language/json/json.worker?worke...
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
✘ [ERROR] Could not read from file: /home/matteo/Coding/pybox/node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/editor.worker.js?worker
node_modules/.pnpm/@svuick+monaco@0.0.3/node_modules/@svuick/monaco/monaco/index.js:6:38:
6 │ ...: () => import('monaco-editor/esm/vs/editor/editor.worker?worker'),
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
✘ [ERROR] Could not read from file: /home/matteo/Coding/pybox/node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/language/html/html.worker.js?worker
node_modules/.pnpm/@svuick+monaco@0.0.3/node_modules/@svuick/monaco/monaco/index.js:9:23:
9 │ ... => import('monaco-editor/esm/vs/language/html/html.worker?worke...
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
✘ [ERROR] Could not read from file: /home/matteo/Coding/pybox/node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/language/typescript/ts.worker.js?worker
node_modules/.pnpm/@svuick+monaco@0.0.3/node_modules/@svuick/monaco/monaco/index.js:8:29:
8 │ ... => import('monaco-editor/esm/vs/language/typescript/ts.worker?w...
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/matteo/Coding/pybox/node_modules/.pnpm/esbuild@0.17.14/node_modules/esbuild/lib/main.js:1636
let error = new Error(`${text}${summary}`);
^
Error: Build failed with 4 errors:
node_modules/.pnpm/@svuick+monaco@0.0.3/node_modules/@svuick/monaco/monaco/index.js:6:38: ERROR: Could not read from file: /home/matteo/Coding/pybox/node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/editor.worker.js?worker
node_modules/.pnpm/@svuick+monaco@0.0.3/node_modules/@svuick/monaco/monaco/index.js:7:23: ERROR: Could not read from file: /home/matteo/Coding/pybox/node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/language/json/json.worker.js?worker
node_modules/.pnpm/@svuick+monaco@0.0.3/node_modules/@svuick/monaco/monaco/index.js:8:29: ERROR: Could not read from file: /home/matteo/Coding/pybox/node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/language/typescript/ts.worker.js?worker
node_modules/.pnpm/@svuick+monaco@0.0.3/node_modules/@svuick/monaco/monaco/index.js:9:23: ERROR: Could not read from file: /home/matteo/Coding/pybox/node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/language/html/html.worker.js?worker
at failureErrorWithLog (/home/matteo/Coding/pybox/node_modules/.pnpm/esbuild@0.17.14/node_modules/esbuild/lib/main.js:1636:15)
at /home/matteo/Coding/pybox/node_modules/.pnpm/esbuild@0.17.14/node_modules/esbuild/lib/main.js:1048:25
at /home/matteo/Coding/pybox/node_modules/.pnpm/esbuild@0.17.14/node_modules/esbuild/lib/main.js:1512:9
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
errors: [
{
detail: undefined,
id: '',
location: {
column: 38,
file: 'node_modules/.pnpm/@svuick+monaco@0.0.3/node_modules/@svuick/monaco/monaco/index.js',
length: 50,
line: 6,
lineText: " editorWorkerService: () => import('monaco-editor/esm/vs/editor/editor.worker?worker'),",
namespace: '',
suggestion: ''
},
notes: [],
pluginName: '',
text: 'Could not read from file: /home/matteo/Coding/pybox/node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/editor/editor.worker.js?worker'
},
{
detail: undefined,
id: '',
location: {
column: 23,
file: 'node_modules/.pnpm/@svuick+monaco@0.0.3/node_modules/@svuick/monaco/monaco/index.js',
length: 55,
line: 7,
lineText: " json: () => import('monaco-editor/esm/vs/language/json/json.worker?worker'),",
namespace: '',
suggestion: ''
},
notes: [],
pluginName: '',
text: 'Could not read from file: /home/matteo/Coding/pybox/node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/language/json/json.worker.js?worker'
},
{
detail: undefined,
id: '',
location: {
column: 29,
file: 'node_modules/.pnpm/@svuick+monaco@0.0.3/node_modules/@svuick/monaco/monaco/index.js',
length: 59,
line: 8,
lineText: " typescript: () => import('monaco-editor/esm/vs/language/typescript/ts.worker?worker'),",
namespace: '',
suggestion: ''
},
notes: [],
pluginName: '',
text: 'Could not read from file: /home/matteo/Coding/pybox/node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/language/typescript/ts.worker.js?worker'
},
{
detail: undefined,
id: '',
location: {
column: 23,
file: 'node_modules/.pnpm/@svuick+monaco@0.0.3/node_modules/@svuick/monaco/monaco/index.js',
length: 55,
line: 9,
lineText: " html: () => import('monaco-editor/esm/vs/language/html/html.worker?worker'),",
namespace: '',
suggestion: ''
},
notes: [],
pluginName: '',
text: 'Could not read from file: /home/matteo/Coding/pybox/node_modules/.pnpm/monaco-editor@0.33.0/node_modules/monaco-editor/esm/vs/language/html/html.worker.js?worker'
}
],
warnings: []
}
Node.js v19.8.1
ELIFECYCLE Command failed with exit code 1.
I suspect it's trying to optimize it by analyzing the imports, and it doesn't understand the ?worker
bit, so it fails to build.
I created a Vite project with:
npm create vite
And followed the prompts for a Svelte TypeScript project.