Inline worker build without any output files or error message.
See original GitHub issue⚠️ IMPORTANT ⚠️ Please check the following list before proceeding. If you ignore this issue template, your issue will be directly closed.
- Read the docs.
- Use Vite >=2.0. (1.x is no longer supported)
- If the issue is related to 1.x -> 2.0 upgrade, read the Migration Guide first.
Describe the bug
I am using monaco editor with inline worker, vite build output nothing. (exit at ✓ 739 modules transformed.
)
(When I used vite 1, it worked as expected.
Reproduction
https://github.com/meowtec/vite-worker-bug-reproduce
System Info
vite
version: 2.0.0-beta.65- Operating System: macOS Catalina
- Node version: v12.18.0
- Package manager (npm/yarn/pnpm) and version: npm 6.14.10
Logs (Optional if provided reproduction)
building for production...
transforming (14) node_modules/monaco-editor/esm/vs/editor/editor.worker.jsThe 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
transforming (105) node_modules/monaco-editor/esm/vs/editor/common/services/editorSimpleWorker.jsThe 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
transforming (297) node_modules/monaco-editor/esm/vs/language/json/_deps/vscode-json-languageservice/seThe 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
✓ 736 modules transformed.
✓ 739 modules transformed.
<----- vite exit here
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Web workers without a separate Javascript file? - Stack Overflow
I'm working on it (or rather on minimising the problem): DynWorker. You can do: var worker = new DynWorker(); worker.inject("foo", function(){...}); ...
Read more >Understanding and Using Web Workers - CODE Magazine
Miguel Castro teaches you the how to use Web Workers to do multi-threaded development in Web applications using JavaScript.
Read more >worker-loader - webpack - JS.ORG
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >Angular compiler options
ts file is supplied without a libraryIndex , an error is produced. A flat module index .d.ts and .js is created with the...
Read more >Worker threads | Node.js v19.3.0 Documentation
The node:worker_threads module enables the use of threads that execute ... If no message is available, undefined is returned, otherwise an object with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In my case, the above error is resolved by
build.rollupOptions.output.manualChunks
.Additional:
Using
?worker&inline
:dev: it works build: output nothing
Using
?worker
:dev: it works too build: worker throws with
Uncaught ReferenceError: window is not defined
(anothor issue to fix)