-
-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zeromq usage with webpack fails #676
Comments
Webpack is likely replacing Line 21 in 9f1172d
We have to provide a more robust solution that works without https://stackoverflow.com/questions/43527016/dirname-is-not-working-in-node-js-with-webpack-bundling |
Hi, thankyou @aminya for your response. This was after I put in `npm install --save-dev process (https://github.com/defunctzombie/node-process#readme) but it seems like that it does not provide the crucial arch/platform .... As you saw, I had the polyfills turned on webpack.plugins.ts, (with On a standalone testcode outside of webpack, they resolve to What do you think should be done in this case? Thank you. |
issue webpack/18987 webpack/webpack#18987 |
and this: electron/forge#3763 |
I suppose I can kludge up something awful on linux side to get past this particular issue, but the interesting thing is what to do on Windows (?!!) I don't yet understand how webpack and electron-forge work in Windows, and how that should interact with the polyfill stuff, and how that impacts zeromq. Uhhh help! |
bloody awful kludge. DON'T USE!
I think maybe instead of trying to depend on fragile stuff like polyfill, maybe zeromq can get some magic variables from somewhere? |
Just rambling now: electron/forge#3763 and webpack/webpack#18987 and Richienb/node-polyfill-webpack-plugin#58 __dirname gets set to '/' when the app finally runs on someone's machine, apparently. zeromq has its own non-trivial setup for compiling the .cc files and such, and so how to best navigate this complexity? |
Can you avoid not bundling zeromq by adding it to the externals? Just copy the files over as is. |
Almost, but not quite. renderer side hangs when I try to send stuff over from the main process using ipcMain. Still working on this avenue. Injecting zeromq on on
l am stuck with 'fs' and 'path' not being available during findAddon. How the heck do people get electron-forge+ webpack and zeromq to work on Windows??? |
Here's an example of Zeromq with Electron from another issue. |
test-ui.zip
Describe the bug
I actually did manage to get zeromq.js + electron to work, sort of. At least running a single test file.
The problem began when I tried to start up zmq.Subscriber sockets in the main thread.
I then got this error:
I saw #675, but I'm not convinced that my fail is related: First off, I am importing the zmq code in index.ts (the main thread), NOT in the renderer. Plus, a bunch of other bug reports (such as #673) seems to hint that zeromq and electron SHOULD work well together.
Furthermore, in a prior life, I did work on an electron app that used the built in
net
fromnode.js
which worked fine.Help!
This is in the index.ts (i.e. the main thread)
Reproducing
I started this test project by doing
npm init electron-app@latest test-ui -- --template=webpack-typescript
I then added
preact
, zeromq, sass, and started to play with it using a single .ts file.Problems occurred when I imported that working zmq code to the main thread (
index.ts
)The same class (which is just a simple Subscriber socket read -> console.log) when run separately
using
npx ts-node test/krapola.ts
runs just fine.And here it is:
LogRelay.ts
Expected behavior
I expect it to work!
Tested on
The text was updated successfully, but these errors were encountered: