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.

Socket.io crashes loading in Electron on MacOS

See original GitHub issue

You 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:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

8reactions
nicolasnoblecommented, Mar 27, 2018

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.

8reactions
ghostcommented, Mar 27, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot load socket.io.js file when using electron
I am trying to make a chat application using Node.js with Electron and Socket.io, but when I try to load /socket.io/socket.io.js , I...
Read more >
electron mac build crashing on startup (signed and notarized)
The apps work perfectly and can be signed and notarized without any issues but when run on MacOS 10.14+ they crash with the...
Read more >
Troubleshooting connection issues | Socket.IO
You are trying to reach a plain WebSocket server · The server is not reachable · The client is not compatible with the...
Read more >
Electron Releases - API Manual
Electron 1.7.3 June 08, 2017 (5 years ago). Bug Fixes. Fixed a crash loading URLs coming from RenderFrameHostImpl::SetNavigationHandle .
Read more >
Debugging Electron.js native crashes on macOS
js. In the case of macOS, this is usually a crash coming from the C++ or Objective-C++ parts of Electron.js, Chromium or Node.js ......
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