importing electron in a WebWorker doesn't work
See original GitHub issueDoing import { ipcRenderer} from 'electron'
(or any other renderer electron module) crashes the app with reason: "crashed"
and exitCode: 11
.
Details
- I’m trying to migrate from Webpack and the same code works there.
nodeIntegrationInWorker
is set to true.- Exit code 11 usually means Segmentation fault.
- One thing that is being logged in the Terminal when the app crashes:
[20890:0831/172750.464535:ERROR:shared_image_manager.cc(267)] SharedImageManager::ProduceOverlay: Trying to Produce a Overlay representation from a non-existent mailbox. [20890:0831/172750.464559:ERROR:skia_output_device_buffer_queue.cc(354)] Invalid mailbox. [20890:0831/172750.464564:ERROR:shared_image_manager.cc(267)] SharedImageManager::ProduceOverlay: Trying to Produce a Overlay representation from a non-existent mailbox. [20890:0831/172750.464569:ERROR:skia_output_device_buffer_queue.cc(354)] Invalid mailbox. [20890:0831/172750.464572:ERROR:shared_image_manager.cc(267)] SharedImageManager::ProduceOverlay: Trying to Produce a Overlay representation from a non-existent mailbox. [20890:0831/172750.464578:ERROR:skia_output_device_buffer_queue.cc(354)] Invalid mailbox. [20890:0831/172750.464580:ERROR:shared_image_manager.cc(267)] SharedImageManager::ProduceOverlay: Trying to Produce a Overlay representation from a non-existent mailbox. [20890:0831/172750.464584:ERROR:skia_output_device_buffer_queue.cc(354)] Invalid mailbox. [20890:0831/172750.464601:ERROR:shared_image_manager.cc(267)] SharedImageManager::ProduceOverlay: Trying to Produce a Overlay representation from a non-existent mailbox. [20890:0831/172750.464606:ERROR:skia_output_device_buffer_queue.cc(354)] Invalid mailbox. [20890:0831/172750.464609:ERROR:shared_image_manager.cc(267)] SharedImageManager::ProduceOverlay: Trying to Produce a Overlay representation from a non-existent mailbox. [20890:0831/172750.464612:ERROR:skia_output_device_buffer_queue.cc(354)] Invalid mailbox.
- Another thing:
Error sending from webFrameMain: Error: Render frame was disposed before WebFrameMain could be accessed at n._sendInternal (node:electron/js2c/browser_init:165:629) at b._sendInternal (node:electron/js2c/browser_init:161:2573) at node:electron/js2c/browser_init:193:729 at new Promise (<anonymous>) at Object.invokeInWebContents (node:electron/js2c/browser_init:193:477) at b.executeJavaScript (node:electron/js2c/browser_init:161:3267) at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
Issue Analytics
- State:
- Created a year ago
- Comments:23 (12 by maintainers)
Top Results From Across the Web
Web workers don't work · Issue #486 · nklayman/vue-cli-plugin ...
Describe the bug Web workers don't work, I get the following error: testWorker.js:1 ... Webpack electron-builder web worker doesn't work ...
Read more >NodeJS modules not supported in Electron Web Workers
In the web worker, you can just import node modules as you normally would in node, with require(). This repository details how to...
Read more >Using Web Workers - Web APIs - MDN Web Docs
Web Workers are a simple means for web content to run scripts in background threads. The worker thread can perform tasks without interfering ......
Read more >How to run background worker processes in an Electron App
As I mentioned already in my introduction article to Electron — Don't do that. Blocking the main process will also block your renderer ......
Read more >Parcel
Parcel supports tree-shaking both ES modules and CommonJS out of the box! It statically analyzes the imports and exports of each module, and...
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
type: "module"
will be supported inv0.9.3
, coming soon. 🚚Awesome! Thanks for all the work you put into this!