@bugsnag/electron does not work with Windows 7 and Electron 19+
See original GitHub issueDescribe 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 bug: https://github.com/libuv/libuv/issues/3260
- Node bug: https://github.com/nodejs/node/issues/41297
- Electron bug: https://github.com/electron/electron/issues/34404
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:
- Created a year ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
Looks like this was fixed in Electron via https://github.com/electron/electron/issues/35219.