firebase --version
3.18.4
"firebase-admin": "^5.12.0",
"firebase-functions": "^1.0.2",
"firebase-tools": "^3.18.4",
tsc --version
Version 2.8.3
In my firebase project I have a file with following import;
file.ts
import admin from "firebase-admin";
// rest of the code
Once I run tsc I am getting following error:
- Starting compilation in watch mode...
functions/file.ts(1,8): error TS1192: Module '"/node_modules/firebase-admin/lib/index"' has no default export.
Is there any way to avoid the error?
Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information.
Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight.
OK I had to use
import * as admin from "firebase-admin";
as mentioned at https://github.com/Microsoft/TypeScript/issues/3337
Most helpful comment
OK I had to use
import * as admin from "firebase-admin";as mentioned at https://github.com/Microsoft/TypeScript/issues/3337