You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have been having some trouble getting threads & threads-plugin to properly work with electron.
I have used it before on a react web app and had no issues, but its not the case for the electorn app.
I have been following the setup documentation, but I seem to have missed something at some point.
Everything is working fine in dev mode but as soon as I build a debian package, install and start it, the workers are not accessible and I get the following error message
but then again its not working either in dev mode or production mode. in production mode it would complain that runAction.ts has no access to packages like electron-fetch.
I know I have to add the worker bundles to the "asarUnpack" option in my package.json, but the workers are not being bundled in the first place.
Any ideas what I might have missed? Help would be much appreciated.
Hi, I have been having some trouble getting threads & threads-plugin to properly work with electron.
I have used it before on a react web app and had no issues, but its not the case for the electorn app.
I have been following the setup documentation, but I seem to have missed something at some point.
Everything is working fine in dev mode but as soon as I build a debian package, install and start it, the workers are not accessible and I get the following error message
Im pretty sure its because the workers are not bundled into own files, like they did on my web version.
My plan is to spawn workers on electrons background process, which is running nodejs.
await spawn<RunAction>(new Worker('./workers/runAction.ts'));
funny thing is that wepack only creates worker bundles when the workers are spawned with the following code:
await spawn<RunAction>(new Worker(new URL('./workers/runAction.ts', import.meta.url)));
but then again its not working either in dev mode or production mode. in production mode it would complain that runAction.ts has no access to packages like electron-fetch.
I know I have to add the worker bundles to the "asarUnpack" option in my package.json, but the workers are not being bundled in the first place.
Any ideas what I might have missed? Help would be much appreciated.
Heres some example code:
runAction.ts:
how I spawn the worker:
await spawn<RunAction>(new Worker('./workers/runAction.ts'));
webpack.config.base.ts:
Please to not close this issue if I dont answer to questions directly. I might be on vacation in between.
Thanks in advance.
The text was updated successfully, but these errors were encountered: