Replies: 2 comments 9 replies
-
Sorry for delay, sounds like a bug, can you create reproducible test repo to investigate it better, thank you |
Beta Was this translation helpful? Give feedback.
9 replies
-
[like] Peter Meldgaard reacted to your message:
…________________________________
From: Alexander Akait ***@***.***>
Sent: Thursday, March 7, 2024 2:33:50 PM
To: webpack/webpack ***@***.***>
Cc: Peter Meldgaard ***@***.***>; Author ***@***.***>
Subject: Re: [webpack/webpack] Problem getting core node api to work in an electron apps webworker (Discussion #17999)
Sorry for delay, I will look soon
—
Reply to this email directly, view it on GitHub<#17999 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABMIZXXMAW4HYVSO7ZHNI2LYXB3E5AVCNFSM6AAAAABCIO4TQOVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DOMBYGI4TS>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm struggling a bit to get webworker to work in my Electron App.
The App is build based on the ElectronReactBoilerplate template from github. It's made with typescript, commonjs mode.
I have not succeed building the App with WP 5 way of bundling webworker. But after a lot of struggling i got it working with a variation from this article: https://dannadori.medium.com/how-to-bundle-webworker-in-npm-package-620dcec922e1.
Now I have a ultra simple packed webworker running, and it's working both in dev and prod/package mode.
So now I started adding my functionality, and here new problems arise. I need a dgram socket in the worker and just adding an
import dgram from 'dgram
and a reference: 'let udpSocket = dgram.createSocket('udp4');' result in webpack errors when running dev packing: Module not found: Error: Can't resolve 'dgram' in '...worker.ts'I have this working perfectly in a Electron Fiddle in pure javascript.
Something suggest that webpack is not adding the core node modules. I have tried removing the 'web' part from targets (''target: ['electron-renderer', 'web'],) but this brings another runtime error about global not defined in my renderer console.
I'm wondering if I need to do a separate bundle for the webworker?
Can anyone help with some suggestions to get around this?
Heres my full webpack config:
Beta Was this translation helpful? Give feedback.
All reactions