Skip to content

docs: broken code samples in several product guides #3731

Description

@armando-navarro

Summary

Reviewing the modular product guides under docs/, I found that the copy-paste code samples in several of them do not compile or parse as written. A developer following a guide hits a TypeScript or syntax error before anything reaches Firebase.

Affected guides and problems

  • App Check, Auth, Database, Functions, Messaging, Remote Config, Storage, Performance (app.config.ts sample): the appConfig object literal closes with }) instead of }, a syntax error.
  • All of the above, plus Firestore: the sample annotates appConfig: ApplicationConfig but never imports ApplicationConfig from @angular/core.
  • App Check: the sample calls getApp() without importing it.
  • Firestore: export Interface UserProfile should be export interface (it appears twice), Observable is used without an rxjs import, and CollectionReference and DocumentReference are used without imports.
  • Auth, Database: the emulator and multiple-instance samples still wrap providers in @NgModule and read environment.firebase, which the standalone app.config.ts setup these guides otherwise teach no longer uses.
  • Messaging: the FcmService example does not compile (an await inside a non-async method, an assignment placed outside the constructor, an undeclared field), and the service-worker sample pins the Firebase CDN to 9.22.0 while the library depends on firebase ^12.4.0.

Part of the messaging problem was reported earlier in #3369.

Scope

Documentation only. A pull request follows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp: docsDocumentation.type: choreMaintenance with no user-facing behavior change.version: current (v17+)Targets the current modular API (v17+).

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions