We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
process.env is undefined
1 parent 6df7bd3 commit 60e443bCopy full SHA for 60e443b
src/browser.js
@@ -214,9 +214,14 @@ function load() {
214
215
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
216
// process.env is undefined in sometimes, and it will throw a exception
217
- if (!r && typeof process !== 'undefined' && process.env) {
218
- r = process.env.DEBUG;
+ try {
+ if (!r && typeof process !== 'undefined' && 'env' in process) {
219
+ r = process.env.DEBUG;
220
+ }
221
+ } catch(error) {
222
+ // Browser throw `process.env is undefined`
223
}
224
+
225
226
return r;
227
0 commit comments