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

Wrong "typings" key in package.json after monorepo refactor. #136

Closed
adamduren opened this issue Nov 14, 2017 · 8 comments
Closed

Wrong "typings" key in package.json after monorepo refactor. #136

adamduren opened this issue Nov 14, 2017 · 8 comments

Comments

@adamduren
Copy link

Reproduction steps

See repo to reproduce.

Description

The path for typings is missing the cjs directory.

"typings": "dist/index.d.ts",

Should be

"typings": "dist/cjs/index.d.ts",

Noticed in the following places:

Results in the following error during compilation with tsc

node_modules/@firebase/database/dist/cjs/index.d.ts(16,35): error TS7016: Could not find a declaration file for module '@firebase/app'. '/workspace/functions/node_modules/@firebase/app/dist/cjs/index.js' implicitly has an 'any' type.
node_modules/@firebase/database/dist/cjs/src/api/Database.d.ts(3,46): error TS7016: Could not find a declaration file for module '@firebase/app'. '/workspace/functions/node_modules/@firebase/app/dist/cjs/index.js' implicitly has an 'any' type.
  Try `npm install @types/@firebase/app` if it exists or add a new declaration (.d.ts) file containing `declare module '@firebase/app';`
node_modules/@firebase/database/dist/cjs/src/core/AuthTokenProvider.d.ts(16,52): error TS7016: Could not find a declaration file for module '@firebase/app'.'/workspace/functions/node_modules/@firebase/app/dist/cjs/index.js' implicitly has an 'any' type.
  Try `npm install @types/@firebase/app` if it exists or add a new declaration (.d.ts) file containing `declare module '@firebase/app';`
node_modules/@firebase/database/dist/cjs/src/core/Repo.d.ts(3,29): error TS7016: Could not find a declaration file for module '@firebase/app'. '/workspace/functions/node_modules/@firebase/app/dist/cjs/index.js' implicitly has an 'any' type.
  Try `npm install @types/@firebase/app` if it exists or add a new declaration (.d.ts) file containing `declare module '@firebase/app';`

Environment

  • Node Version: v8.9.1 (also tried 6.x, 7.x)
  • NPM Version: v5.5.1
  • TypeScript Version: v2.4.2 / v2.6.1
@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.

@adamduren
Copy link
Author

Moved to firebase-admin-node from firebase/firebase-js-sdk#318.

@0x80
Copy link

0x80 commented Nov 18, 2017

@adamduren How do you work around this issue?

I've tried adding them to my tsconfig include, but that doesn't seem to cut it.

"include": [
    "src/**/*",
    "node_modules/@firebase/app/dist/cjs/index.d.ts",
    "node_modules/@firebase/util/dist/cjs/index.d.ts"
  ],

It seems that the compiler finds the right type definition file, but is somehow still not happy:

node_modules/@firebase/database/dist/cjs/index.d.ts(16,35): error TS7016: Could not find a declaration file for module '@firebase/app'. '/Users/me/myproject/node_modules/@firebase/app/dist/cjs/index.js' implicitly has an 'any' type.
Try npm install @types/@firebase/app if it exists or add a new declaration (.d.ts) file containing declare module '@firebase/app';

16 import { FirebaseNamespace } from '@firebase/app';
~~~~~~~~~~~~~~~

If I set "skipLibCheck": true I still get errors on implicit any:

node_modules/@firebase/util/src/assert.ts(24,32): error TS7006: Parameter 'assertion' implicitly has an 'any' type.

24 export const assert = function(assertion, message) {
~~~~~~~~~

@0x80
Copy link

0x80 commented Nov 18, 2017

Ah I get it now I think.

skipLibCheck only works if you don't explicitly add those *.d.ts files to you own files list, because then they're not considered external lib anymore. Using the skipLibCheck without listing the files at least lets me compile my own code.

But of course this is still a problem, because now all checks for all external modules are disabled.

@raDiesle
Copy link

already solved? It's closed, but still I get this issue and I do not see referenced code-fix.

@adamduren
Copy link
Author

Issue appears open for me

@hiranya911
Copy link
Contributor

This should be fixed in the 5.5.1 release. We no longer use the typings from @firebase/database.

@jshcrowthe is working separately on getting the typings of @firebase/database sorted out. Hopefully we will be able to consume them in the admin SDK in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants