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

firebase-admin 5.12.0 fails to compile with tsc #252

Closed
ndkcha opened this issue Apr 6, 2018 · 9 comments
Closed

firebase-admin 5.12.0 fails to compile with tsc #252

ndkcha opened this issue Apr 6, 2018 · 9 comments

Comments

@ndkcha
Copy link

ndkcha commented Apr 6, 2018

[READ] Step 1: Are you in the right place?

  • For issues or feature requests related to the code in this repository
    file a Github issue.

[REQUIRED] Step 2: Describe your environment

  • Operating System version: OSX 10.11.3
  • Firebase SDK version: 5.12.0
  • Library version: _____
  • Firebase Product: firebase-admin for node.js (auth, database, storage, etc)

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

What happened? How can we make the problem occur?

I'm using typescript environment to code the server on Node.js
When I compile the code, it's returning with an error:

> rimraf dist && tsc --outDir dist

node_modules/firebase-admin/lib/index.d.ts(18,22): error TS7016: Could not find a declaration file for module '@google-cloud/storage'. '/<path-to-project>/node_modules/@google-cloud/storage/src/index.js' implicitly has an 'any' type.
npm ERR! code ELIFECYCLE
npm ERR! errno 2

I have the upgraded firebase-admin to the latest version (5.12.0)

"firebase-admin": "^5.12.0",
@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.

@google-oss-bot
Copy link

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

@hiranya911
Copy link
Contributor

Compiles fine for me. Make sure GCS typings (@types/google-cloud__storage package) are installed and visible to tsc. That is the typeRoots are defined correctly in the project config.

@ndkcha
Copy link
Author

ndkcha commented Apr 6, 2018

I have @types/google-cloud_storage package installed. and here is my tsconfig file.
Can you check if it is correct or not?

screen shot 2018-04-06 at 1 11 50 pm

@rwpino
Copy link

rwpino commented Apr 6, 2018

I have the same issue

@hiranya911
Copy link
Contributor

You have specified types in the config. This means only reflect-metadata types are visible to the compiler.

See https://www.typescriptlang.org/docs/handbook/tsconfig-json.html

If types is specified, only packages listed will be included. For instance:

{
   "compilerOptions": {
       "types" : ["node", "lodash", "express"]
   }
}

This tsconfig.json file will only include ./node_modules/@types/node, ./node_modules/@types/lodash and ./node_modules/@types/express. Other packages under node_modules/@types/* will not be included.

@ndkcha
Copy link
Author

ndkcha commented Apr 6, 2018

Even when i add,"types": [ "reflect-metadata", "google-cloud__storage" ], it returns me the same error.

@rwpino
Copy link

rwpino commented Apr 6, 2018

I add

 "@google-cloud/storage": "^1.6.0",
 "@types/google-cloud__storage": "^1.1.7",

to my package.json with the firebase-admin

"firebase-admin": "^5.12.0",

and I m having the same issue,

my tsconfig look like

{
    "compilerOptions": {
        "outDir": "dist",
        "target": "es6",
        "module": "commonjs",
        "noImplicitAny": true,
        "experimentalDecorators": true,
        "removeComments": true,
        "preserveConstEnums": true,
        "emitDecoratorMetadata": true,
        "sourceMap": false,
        "rootDirs": [
            "src",
            "test",
            "node_modules/@types"
        ]
    },
    "exclude": [
        "node_modules"
    ]
}

in the typescript website says if you don't include typeRoots parameter the @types will be added automatically

I downgrade the library until 5.1.0 , after this one, my compilation start to fails

@shahidcodes
Copy link

For now I am skipping lib check in typescript config until we've a workaround or a fix
"skipLibCheck": true,

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

5 participants