process.env is undefined by aylanbrown · Pull Request #723 · debug-js/debug
| // If debug isn't set in LS, and we're in Electron, try to load $DEBUG | ||
| if (!r && typeof process !== 'undefined' && 'env' in process) { | ||
| // process.env is undefined in sometimes, and it will throw a exception | ||
| if (!r && typeof process !== 'undefined' && 'env' in process && process.env !== undefined) { |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second two checks can be simplified as just process.env.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I changed it
Can you squash please? :)
I built my project by webpack, and browser throw 'production is not undefined'. Check only process.env is undefined is useless, I use try {} catch(e){} to resolve it
@xamgore I'm very aware. I was not near a computer at the time and the mobile client does not have the feature.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters