angular / angularfire

Angular + Firebase = ❤️
https://firebaseopensource.com/projects/angular/angularfire2
MIT License
7.69k stars 2.19k forks source link

Missing exports in v18? #3538

Closed petrot closed 4 months ago

petrot commented 4 months ago

Version info

Angular: 18.0.1 Firebase: 10.12.1 AngularFire: 18.0.0 Other (e.g. Ionic/Cordova, Node, browser, operating system): Ionic 8.2.0

How to reproduce these conditions

I have the following initialization in my main.ts:

[...]
provideAuth(() => {
      if (Capacitor.isNativePlatform()) {
        return initializeAuth(getApp(), {
          persistence: indexedDBLocalPersistence,
        });
      } else {
        return getAuth();
      }
    }),

It worked before updating to v18 with the following imports:

import {
  indexedDBLocalPersistence,
  getAuth,
  initializeAuth,
  provideAuth,
} from '@angular/fire/auth';

In v18 I have to import the indexedDBLocalPersistence from firebase/auth.

import { indexedDBLocalPersistence } from '@firebase/auth';

Is it normal??

Debug output

Errors in the JavaScript console

SyntaxError: The requested module '/@fs/Users/tomi/Dev/tamaspetro/rofi-cap/.angular/cache/18.0.1/vite/deps/@angular_fire_auth.js?v=aa35568b' does not provide an export named 'indexedDBLocalPersistence' 

Expected behavior

Allow import from @angular/fire/auth (??)

Actual behavior

Have to import from @firebase/auth

jnizet commented 4 months ago

Have you tried version 18.0.1, because a similar issue was fixed: https://github.com/angular/angularfire/issues/3536.

petrot commented 4 months ago

@jnizet thanks, the problem has been solved with 18.0.1!