Skip to content

Conversation

paulstelzer
Copy link
Contributor

@paulstelzer paulstelzer commented May 8, 2018

Generic type 'Observer' requires 1 type argument(s). Fix #787

Generic type 'Observer' requires 1 type argument(s).
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@paulstelzer paulstelzer changed the title Fix #787 Fixed Generic type Observer May 8, 2018
@paulstelzer
Copy link
Contributor Author

I signed the CLA!

@googlebot
Copy link

CLAs look good, thanks!

@jshcrowthe
Copy link
Contributor

Hey @paulstelzer, thanks so much for the quick triage and the PR I think we are going to roll this change into #786 (facilitating both the single and multi-generic syntaxes).

Copy link
Contributor

@jshcrowthe jshcrowthe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take that back 👍 this looks great! Thanks again!

@jshcrowthe jshcrowthe merged commit 785cc8b into firebase:master May 8, 2018
@mparpaillon
Copy link

This change introduced a bug I think

modules/@firebase/auth-types/index.d.ts(282,21): error TS2314: Generic type 'Observer<V, E>' requires 2 type argument(s).

@paulstelzer
Copy link
Contributor Author

paulstelzer commented Jun 19, 2018

@mparpaillon with [email protected] the observer only has 1 type argument, 2 type arguments was before - so I think you not updated firebase correctly. Could you please install again?

@mparpaillon
Copy link

Hmmm that's odd. I've reinstalled it and still got the "@firebase/[email protected]" in which the Observer requires 2 arguments

// subscribe.d.ts
export interface Observer<V, E> {
    next(value: V | null): any;
    error(error: E): any;
    complete(): any;
}

In my package.json I have "firebase": "^5.0.4"

It's an Angular project (6.0.2). I use angularfire2 (5.0.0-rc.9).
To install firebase I just npm i firebase@latest

Something I did wrong ?

@mparpaillon
Copy link

I looked at package.json file in node_modules/firebase and found those dependencies

...
"_id": "[email protected]",
...
"dependencies": {
  "@firebase/app": "0.3.3",
  "@firebase/auth": "0.5.3",
  "@firebase/database": "0.3.3",
  "@firebase/firestore": "0.5.4",
  "@firebase/functions": "0.2.4",
  "@firebase/messaging": "0.3.4",
  "@firebase/polyfill": "0.3.3",
  "@firebase/storage": "0.2.3"
}

No @firebase/util. Is that normal ?
I'm probably missing something obvious here

@paulstelzer
Copy link
Contributor Author

paulstelzer commented Jun 19, 2018

@mparpaillon The latest version is @firebase/[email protected] . So it's normal that you get the error because the util version is too old. Try to clean the cache or remove the node_modules folder

It's normal that there is no @firebase/util inside node_modules/firebase/package.json

@mparpaillon
Copy link

Well it doesn't work. I guess a package is installing firebase with older dependencies.

In node_module/@firebase/util, I have the old version of the subscribe.d.ts file.
But in node_module/firebase/node_modules/@firebase/util I have the newest version.

Apparently the old one is used... I don't know why

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Error] Firebase 5.0.0: Generic type 'Observer<T>' requires 1 type argument(s).

5 participants