3

This question is actually similar to this

and this

I am setting up the config.ts file for Firebase. 'initializeApp' is not working and giving the error in the title above. Just wondering if this is a firebase global install issue or if I should be calling initializeApp differently.

import * as firebase from 'firebase'
import { config } from 'process'

const config = {

}

firebase.initializeApp(config)
temporary_user_name
  • 35,956
  • 47
  • 141
  • 220
Mars2024
  • 364
  • 3
  • 15

1 Answers1

11

Try this??

import firebase from "firebase/app";
import "firebase/firestore";
Aaron Saunders
  • 33,180
  • 5
  • 60
  • 80
  • Thank you, I was trying to check if I could import * as firebase from 'firebase' from different paths, local or global, but it seems like doing the regular import solved it, ugh. The standard import firebase from 'firebase' worked, but it made firebase.initializeApp make it (alias) namespace. So i was suspicious' – Mars2024 Jan 20 '21 at 17:26
  • Oh cool I recently found one of your react ionic articles – Mars2024 Feb 12 '21 at 05:20
  • there is alot of ionic react content on my youtube channel and dev.to – Aaron Saunders Feb 12 '21 at 06:50
  • Hi Aaron is it okay to use .JS files in Ionic instead of .TSX files? I find I've fixed some issues by doing this. – Mars2024 Apr 13 '21 at 19:09
  • @JedLancer yes you can – Aaron Saunders Apr 13 '21 at 22:07