Argument of type 'EnvironmentProviders' is not assignable to parameter of type...

Discussão em 'Angular' iniciado por Igor Urdenko, Abril 4, 2025.

  1. Igor Urdenko

    Igor Urdenko Guest

    I am working on an Angular project that is deployed on Firebase. All the tutorials about Firebase suggest the following way to store Firebase in the app.config.ts:

    export const appConfig: ApplicationConfig = {
    providers: [
    importProvidersFrom(
    provideFirebaseApp(() => initializeApp(environment.firebase)), /* The problem line */
    provideFirestore(() => getFirestore()),
    ),
    provideRouter(routes)
    ],
    };


    I am currently have an error that is marked in VS Code and reported during ng serve: "Argument of type 'EnvironmentProviders' is not assignable to parameter of type 'ImportProvidersSource'.ts(2345)"

    And I have no idea what to do and how to resolve that. I hope someone here can help me with that.

    I tried many times different things. I have totally deleted and recreated my Firebase project, my application in Firebase, my Angular project. Nothing works.

    If I am deleting the problem line, then the next one reporting the same problem.

    Continue reading...

Compartilhe esta Página