Hi, when I do these imports in an Angular service, it runs into a compilation error.
[firebase-authentication.service.ts]
... ...
import { Injectable } from '@angular/core';
import firebase from 'firebase/app';
import 'firebase/app';
import 'firebase/auth';
import 'firebase/firestore';
... ...
ERROR in src/app/service/sdk/authentication/firebase-authentication.service.ts(3,8): error TS1192: Module '"/vagrant/workspace/src/gitlab.com/tamama/ai-google-prive-dialogflow/ai-google-prive-dialogflow/target/angular/tamama/node_modules/firebase/index"' has no default export.
...
However, when I replace one of the line by:
import * as firebase from 'firebase/app';
It compiles. Any best practice?
Kind regards,
Tamama
Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight.
Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information.
Hi @tamama! For TypeScript you need to use
import * as firebase from 'firebase/app';
// You don't need to import firebase/app either since it's being imported above
import 'firebase/auth';
import 'firebase/firestore';
That should do the trick, and thanks for using the sub packages! 馃檶
Hey @davideast, thank you so much!
Kind regards,
Tamama
Hello, I am getting this issue with create-react-app with typescript defaults
error:
import * as firebase from "firebase/app";
/// etc
componentWillMount() {
const ref = firebase.database().ref("/projects");
/// etc
}

For the issue of firesql change the firebase import in firesql.d.ts file to be like this :
From import firebase from 'firebase/app'; To import * as firebase from 'firebase/app';
Most helpful comment
Hi @tamama! For TypeScript you need to use
That should do the trick, and thanks for using the sub packages! 馃檶