Conversation
maneesht
commented
Apr 10, 2026
- Added NEXT_PUBLIC__FIREBASE_DEFAULTS__ to the auto-init allowlist
🦋 Changeset detectedLatest commit: c17ec0b The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Code Review
This pull request adds support for Next.js public environment variables as a fallback for Firebase defaults and introduces error logging. The review feedback highlights a naming inconsistency in the new environment variable and identifies redundant logging that should be consolidated to avoid duplicate console output.
I am having trouble creating individual review comments. Click here to see my feedback.
packages/util/src/defaults.ts (72-74)
The variable name NEXT_PUBLIC__FIREBASE_DEFAULTS__ appears to be missing an underscore. The original variable is __FIREBASE_DEFAULTS__ (starting with two underscores). When prepending the Next.js NEXT_PUBLIC_ prefix, the resulting name should typically be NEXT_PUBLIC___FIREBASE_DEFAULTS__ (with three underscores) to maintain consistency with the original name and follow the standard prefixing pattern. Using only two underscores implies the prefix is being applied to _FIREBASE_DEFAULTS__.
const defaultsJsonString =
process.env.__FIREBASE_DEFAULTS__ ||
process.env.NEXT_PUBLIC___FIREBASE_DEFAULTS__;
packages/util/src/defaults.ts (118-119)
The error message is being logged twice, once with console.info and once with console.error. This is redundant and clutters the console output. If the intention is to make the error more visible, you should replace the console.info call with console.error and update the documentation in the comment above (line 115) to reflect this change. Otherwise, the added console.error should be removed to avoid duplicate logs.
console.error(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);