admin管理员组

文章数量:1386226

I updated Angular from 18 to 19 with ng update @angular/core@19 @angular/cli@19, and manually updated "@angular/core": "^18.0.5" to "@angular/fire": "19.0.0".


@NgModule({
    imports: [
        ...
        AngularFireModule.initializeApp(firebaseConfig),
        AngularFirestoreModule,
        ...
   ]

@Injectable({
  providedIn: 'root',
})
export class RepositoryService {
  constructor(private angularFirestore: AngularFirestore) { }
...

I expect to boot an app, but having this error

ERROR RuntimeError: NG0203: The `EnvironmentInjector` token injection failed. `inject()` function must be called from an injection context such as a constructor, a factory function, a field initializer, or a function used with `runInInjectionContext`. Find more at /errors/NG0203

本文标签: