Skip to content

Commit ff0e2af

Browse files
committed
Fix modular autoinit breakage
I ran into this issue updating dependencies for a Nuxt 3 app. The problem is that `process.{client,server,dev}` are defined even on the client, so the client ends up broken with errors like: ``` Uncaught TypeError: can't access property "__FIREBASE_DEFAULTS__", process.env is undefined ``` Since the code only uses `process.env`, this updates the check to look explicitly for `process.env`.
1 parent 397317b commit ff0e2af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/util/src/defaults.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const getDefaultsFromGlobal = (): FirebaseDefaults | undefined =>
5757
* process.env.__FIREBASE_DEFAULTS_PATH__
5858
*/
5959
const getDefaultsFromEnvVariable = (): FirebaseDefaults | undefined => {
60-
if (typeof process === 'undefined') {
60+
if (typeof process == 'undefined' || typeof process.env === 'undefined') {
6161
return;
6262
}
6363
const defaultsJsonString = process.env.__FIREBASE_DEFAULTS__;

0 commit comments

Comments
 (0)