angularfire
angularfire copied to clipboard
AngularFire 17.1.0 breaks - Argument of type 'EnvironmentProviders' is not assignable to parameter of type 'ImportProvidersSource'
Version info
Angular:
Angular: 17.3.8
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, localize, material, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1703.7
@angular-devkit/build-angular 17.3.7
@angular-devkit/core 17.3.7
@angular-devkit/schematics 17.3.7
@angular/cli 17.3.7
@angular/fire 17.1.0
@angular/pwa 17.3.7
@schematics/angular 17.3.7
rxjs 7.8.1
typescript 5.4.5
zone.js 0.14.5
Firebase:
firebase 10.12.0
AngularFire:
@angular/fire 17.1.0
Other (e.g. Ionic/Cordova, Node, browser, operating system):
Ionic 8.1.1.
How to reproduce these conditions
Compile app with AngularFire 17.0.1 everything works, compile against 17.1.0, it results in the error message:
[ng] Error: src/main.ts:139:9 - error TS2345: Argument of type 'EnvironmentProviders' is not assignable to parameter of type 'ImportProvidersSource'.
Relevant code in main.ts
document.addEventListener('DOMContentLoaded', () => {
bootstrapApplication(AppComponent, {
providers: [
Capacitor.isNativePlatform() ? provideNgxStripe(environment.stripe.publishableKey) : [],
importProvidersFrom(
LoggerModule.forRoot({
serverLoggingUrl: '/api/logs',
level: environment.loglevel,
serverLogLevel: NgxLoggerLevel.OFF
}),
IonicModule.forRoot({
animated: true,
scrollAssist: false,
scrollPadding: false
}),
ReactiveFormsModule,
AppRoutingModule,
ServiceWorkerModule.register('ngsw-worker.js', {
enabled: environment.production,
registrationStrategy: 'registerWhenStable:30000',
scope: '/'
}),
provideFirebaseApp(() => {
const app = initializeApp(environment.firebase)
return app;
}),
provideAuth(() => {
if (Capacitor.isNativePlatform()) {
return initializeAuth(getApp(), {
persistence: indexedDBLocalPersistence
});
}
else {
const auth = getAuth();
if (environment.emulation) {
connectAuthEmulator(auth, 'http://localhost:9099');
}
return auth;
}
}),
provideFirestore(() => {
const firestore = getFirestore();
if (environment.emulation) {
connectFirestoreEmulator(firestore, 'localhost', 8080);
}
return firestore;
}),
provideMessaging(() => {
const messaging = getMessaging();
return messaging;
}),
provideStorage(() => {
const storage = getStorage();
if (environment.emulation) {
connectStorageEmulator(storage, 'localhost', 9199);
}
return getStorage();
}),
provideFunctions(() => {
const functions = getFunctions(getApp(), 'europe-west1');
if (environment.emulation) {
connectFunctionsEmulator(functions, 'localhost', 5001);
}
return functions;
}),
HttpClientModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [HttpClient]
}
}),
NgOptimizedImage),
{
provide: APP_INITIALIZER,
useFactory: languageInitializer,
deps: [LanguageService, SplitpaneService, Router],
multi: true
},
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
{ provide: ErrorHandler, useClass: GlobalErrorHandlerService },
{
provide: APP_INITIALIZER,
useFactory: (FontawesomeService: FontawesomeService) => async () => {
await FontawesomeService.addIcons();
},
deps: [FontawesomeService],
multi: true,
},
provideHttpClient(withInterceptorsFromDi()),
{
provide: HIGHLIGHT_OPTIONS,
useValue: {
fullLibraryLoader: () => import('highlight.js'),
themePath: 'assets/ngx-highlightjs/atom-one-light.css'
}
}
]
}).then(() => { })r
.catch(err => console.log(err));
});
I can just keep using 17.0.1 for now as i don't really need the Vertex AI wrapper yet