Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript (tsc) firebase-admin has no default export #287

Closed
reyou opened this issue Jun 2, 2018 · 3 comments
Closed

Typescript (tsc) firebase-admin has no default export #287

reyou opened this issue Jun 2, 2018 · 3 comments

Comments

@reyou
Copy link

reyou commented Jun 2, 2018

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?

@google-oss-bot
Copy link

Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information.

@google-oss-bot
Copy link

Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight.

@reyou
Copy link
Author

reyou commented Jun 3, 2018

OK I had to use

import * as admin from "firebase-admin";

as mentioned at microsoft/TypeScript#3337

@reyou reyou closed this as completed Jun 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants