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.

@bugsnag/electron does not work with Windows 7 and Electron 19+

See original GitHub issue

Describe the bug

The os.hostname() node API throws on Windows 7 with Electron 19+ with a uv_os_gethostname returned ENOSYS error. This API is used in @bugnsag/cuid/lib/fingerprint.js, and causes a crash on startup.

libuv and node don’t support Windows 7, so those projects seem very unlikely address this. Electron claims support for Windows 7 but it’s unclear if they will address this or not (currently looking like not).

I was able to address this in my project with this patch:

diff --git a/node_modules/@bugsnag/cuid/lib/fingerprint.js b/node_modules/@bugsnag/cuid/lib/fingerprint.js
index 5f9f765..ab1a3a7 100644
--- a/node_modules/@bugsnag/cuid/lib/fingerprint.js
+++ b/node_modules/@bugsnag/cuid/lib/fingerprint.js
@@ -1,9 +1,17 @@
 var pad = require('./pad.js');
 
+function tryGetHostname() {
+  try {
+    return os.hostname();
+  } catch (err) {
+    return '';
+  }
+}
+
 var os = require('os'),
     padding = 2,
     pid = pad(process.pid.toString(36), padding),
-    hostname = os.hostname(),
+    hostname = tryGetHostname(),
     length = hostname.length,
     hostId = pad(hostname
       .split('')

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
NemoAlexcommented, Jul 31, 2022

I have made a test on Electron Fiddle: https://gist.github.com/NemoAlex/431a61e8464ee6d606f3a02868c66017 Electron 19 Binary uses Node.js 16.14.2, maybe version before 16.14.0(libuv 1.42.0) was fine. Such as Electron 18 uses Node.js 16.13.2, can pass the test. https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V16.md

0reactions
jeremyspiegelcommented, Sep 22, 2022

Looks like this was fixed in Electron via https://github.com/electron/electron/issues/35219.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Electron integration guide - Platforms - Bugsnag docs
Add Bugsnag to your Electron (v10.1.4+) projects to automatically capture and report ... Sometimes it is useful to manually notify Bugsnag of a...
Read more >
CHANGELOG.md · jb-fix-disable-gpu · RocketChat / Rocket.Chat ...
Features. Electron dl for improve download experience (#2200) (a132009) ... Add run at startup option on Windows; Fix issues with Windows 7 notifications ......
Read more >
Atom (text editor) - Wikipedia
Atom was a free and open-source text and source code editor for macOS, Linux, and Microsoft ... It was based on the Electron...
Read more >
New Inkdrop installation fails to open on new Windows 11 ...
Sophos did not report any issues with the app. ... I can also see Inkdrop has 3 processes as it's an Electron app....
Read more >
lvZ - River Thames Conditions - Environment Agency - GOV.UK
Taikomoji fizika, How does australian parliament work, E14133 sony laptop, ... Lietuvos bankas vilniuje, Engel mt45fcp, Arcview gis 3.3 windows 7, ...
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