Socket.io crashes loading in Electron on MacOS
See original GitHub issueYou want to:
- report a bug
- request a feature
Current behaviour
Loading socket.io fails under MacOS with the Electron runtime:
dyld: lazy symbol binding failed: Symbol not found: _SSL_library_init
Referenced from: /Users/nnoble/test/node_modules/uws/uws_darwin_57.node
Expected in: flat namespace
dyld: Symbol not found: _SSL_library_init
Referenced from: /Users/nnoble/test/node_modules/uws/uws_darwin_57.node
Expected in: flat namespace
Steps to reproduce (if the current behaviour is a bug)
On MacOS:
$ git clone https://github.com/nicolasnoble/socketio-electron-testcase.git
$ cd socketio-electron-testcase
$ npm install
$ npm start
Expected behaviour
Loading the module properly.
Setup
- OS: MacOS 10.13.3
- browser: not applicable
- socket.io version: 2.0.4
- Electron version: 1.8.4
Other information (e.g. stacktraces, related issues, suggestions how to fix)
This issue is highly linked to #2984, in a very bad way. It seems the uws
extension code is trying to load the nodejs runtime under Electron, which is utterly wrong and helplessly broken, especially since the uws extension seems to be no longer maintained. The two runtimes are different when it comes to symbols and behavior, and trying to load a node extension into the Electron runtime simply will never work properly in all platforms. This may kinda works on some, but evidently, not on MacOS.
The uws
extension seems like a bad dependency to have for being able to run on all runtimes and platforms, and potentially relying on https://github.com/nodejs/node/issues/19308 to pass might be the right thing to do here.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top GitHub Comments
Right, and that attitude right there tells me that uws is the wrong fit for socket.io, and that if socket.io is willing to keep on forcing people to use uws, then socket.io is also in the wrong.
Thanks, I will seek to use another project.
If I make a hammer and people try and use it as a saw, it is not my problem.
From the start I have targeted NPM + Node.js and nothing else. When people try and use it in the browser, in Electron, in NEXE, in WebPack, on FreeBSD, on OpenBSD, inside an oven, on an iWatch or under water it’s not my task to check for that case. There are literally hundreds of different set-ups and combinations of different environments that people combine in any way they see fit.
I only target Node.js and it works for Node.js, everything else is just invalid usage. There is no “blind” loading of pre-compiled binaries - they are ordered by official Node.js ABIs and follows official Node.js docs for native addons.