question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

importing electron in a WebWorker doesn't work

See original GitHub issue

Doing 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:closed
  • Created a year ago
  • Comments:23 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
caoxiemeihaocommented, Sep 1, 2022

type: "module" will be supported in v0.9.3, coming soon. 🚚

1reaction
astoilkovcommented, Sep 11, 2022

Awesome! Thanks for all the work you put into this!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found