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.

Version prints `undefined`

See original GitHub issue

The current code assumes that /etc/os-release file will always have a VERSION=xxx entry on linux based systems. This is not true for a rolling distro like Arch linux.

The code in envinfo will fallback to an empty array if that’s the case, but it still assumes that the array has two entries one line later.

https://github.com/tabrindle/envinfo/blob/120a367c1c89698a18114cdf32c86b29f813fd1f/src/helpers/system.js#L46-L47

Out of bound accesses in JS return undefined which will be cast to a string in the template literal. This leads to the following output on my system:

Linux 5.2 Arch Linux undefined

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ryhincheycommented, Apr 16, 2020

This is still an issue. I just pulled the latest archlinux docker image and there is no /etc/os-release. This makes envinfo crash

0reactions
ryhincheycommented, Mar 18, 2021

closing this issue in favor of https://github.com/tabrindle/envinfo/issues/190

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why the console.log prints to the console "undefined" when I ...
I try to add getSleepHours() in the const getActualSleepHours() to have a sum. But the console.log prints undefined and I don't know what...
Read more >
"npm show <package>@<unpublished-version>" prints ...
I'm opening this issue because: npm is crashing. npm is producing an incorrect install. npm is doing something I don't understand.
Read more >
Why does console.log() return 'undefined'? - Bits and Pieces
log() in the terminal, you will get back two values, though you may have only expected to receive one. The first value printed...
Read more >
7 Tips to Handle undefined in JavaScript - Dmitri Pavlutin
A detailed article about 'undefined' keyword in JavaScript. 7 tips on how to handle correctly 'undefined' and increase code durability.
Read more >
undefined - JavaScript - MDN Web Docs - Mozilla
The global undefined property represents the primitive value undefined. It is one of JavaScript's primitive types.
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