0

I've been trying to query data on Firebase using querying lists.

When I attempt something analogous to what is described in that documentation:

getMatchesFiltered(matchId: string, filter: string, sortDirection: string, pageIndex: number, pageSize: number){
    let queryObservable = this.db.list('/matches', ref => ref.orderByKey(true).limitToFirst(2));
    return queryObservable;
  }

I got an "Argument of type '{ query: { ...}; }' is not assignable to parameter of type 'FirebaseListFactoryOpts' " error, which led me to this helpful SO post. However, when I tried to change the above to

getMatchesFiltered(matchId: string, filter: string, sortDirection: string, pageIndex: number, pageSize: number): AngularFireList<Match[]>{
    let queryObservable = this.db.list('/matches', ref => ref.orderByKey(true).limitToFirst(2).valueChanges());
    return queryObservable;
  }

and add AngularFireList to the 'angularfire2/database' imports, I get the following error:

ERROR in src/app/database.service.ts(7,81): error TS2305: Module '"/Users/mf/Desktop/dataJitsu/node_modules/angularfire2/database"' has no exported member 'AngularFireList'.

This suggests to me that perhaps I have an old version of angularfire2? Indeed, my package.json says,

"angularfire2": "^4.0.0-rc0",

And I believe that the new AngularFireList list stuff is from v. 5.x.x?

However, when I try to update, it doesn't let me. When I run npm outdated, this is what I see:

npm outdated showing angularfire2 WANTED version remaining at 4.0.0-rc0

Note that the WANTED version of angularfire2 is still 4.0.0-rc0.

Which brings us finally to my question: How do I figure out which package(s) want my versions to stay where they are? In other words, what's holding me back from updating further? Alternatively, if anyone knows how to solve this problem on the angularfire2 front, I'm all ears for that, too.

Atticus29
  • 4,190
  • 18
  • 47
  • 84

1 Answers1

0

The Wanted Version stays at 4.0.0-rc0 because of Semantic Versioning in your package.json ("angularfire2": "^4.0.0-rc0")

As a consumer, you can specify which kinds of updates your app can accept in the package.json file.

If you were starting with a package 1.0.4, this is how you would specify the ranges:

  • Patch releases: 1.0 or 1.0.x or ~1.0.4
  • Minor releases: 1 or 1.x or ^1.0.4
  • Major releases: * or x

The other issue is hard to say without seeing more relevant code. I would start with checkig this post

Tim Martens
  • 1,464
  • 9
  • 18
  • my question about Semantic Versioning is less, "what is it?" and more, "how do I chase down the package(s) that is/are the limiting factors"? – Atticus29 Jun 17 '18 at 03:30
  • 1
    I don't think there are any other packages preventing you to upgrade your `angularfire` library. It's just the annotation in your config `^4.0.0-rc0`. `^4` means: only upgrade minor releases. Angularfire2 version 5 is a major release update. You could change your config to `"angularfire2": ^5.0.0-rc` or `"angularfire2": *` and then run `npm outdated` again – Tim Martens Jun 19 '18 at 05:09