I have been upgrading from Firebase 8 to Firebase 9 (modular web version) and have run into problems with Typescript compiler problems. The upgrade process is described here:
https://firebase.google.com/docs/web/modular-upgrade
Previously Firebase was imported and initialised thus:
import app from 'firebase/app';
const firebaseApp: firebase.app.App = firebase.initializeApp(options);
In Firebase 9, the recommended approach is to
import { initializeApp } from "firebase/app"
const firebaseApp = initializeApp({ /* config */ });
I want to give the const firebaseApp a typing as I did before. How do i do this?
I have also got lots of weird typing errors generated by the Typescript compiler that didn't happen with Firebase 8.
node_modules/@firebase/auth/dist/auth-exp-public.d.ts:1097:47 - error TS2748: Cannot access ambient const enums when the '--isolatedModules' flag is provided.
1097 static readonly FACEBOOK_SIGN_IN_METHOD = SignInMethod.FACEBOOK; ~~~~~~~~~~~~ How do I get rid of these? I deleted node_modules/@firebase and reinstalled firebase 9 but it made no difference.