fix(schematics): only emit FirebaseOptions keys in the generated app config#3707
Open
armando-navarro wants to merge 1 commit into
Open
Conversation
…config The Firebase CLI's apps.sdkconfig response includes management-API fields (projectNumber, version, locationId) alongside the web app config. The schematic only deleted locationId and inlined the rest into initializeApp(), so the generated app failed to compile with TS2769: 'projectNumber' does not exist in type 'FirebaseOptions'. Keep only the keys FirebaseOptions accepts, so future additions to the CLI response cannot break the generated config again.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ng add @angular/fireinlines the Firebase CLI'sapps.sdkconfigresponse intoinitializeApp(). That response includes management-API fields (projectNumber,version,locationId) thatFirebaseOptionsdoes not accept; onlylocationIdwas being stripped (added for #3452 / #3556), so the generated app fails to compile withTS2769: 'projectNumber' does not exist in type 'FirebaseOptions'. This is the third report of the class.This replaces the single-key delete with an allowlist of the keys
initializeApp()accepts, so future additions to the CLI response can't break the generated config.Companion PR #3706 declares the ES2022 lib the
Object.fromEntrieshere relies on (IDE-only; not required for CI).Fixes #3675