I'm currently implementing pagination for a list of items using Vuefire, and encountering an error with the following code snippet (the function works properly with startAt()
but not with startAfter()
)
lastVisible
is an object within my component's state containing the property expire_date
(a UNIX timestamp)
Below is the error message I am receiving
Any suggestions on what might be causing this?
async seeFurtherGames() {
var games_ref = db.ref('games')
console.log("GameBrowser.seeOlderGames()", this.lastVisible, games_ref)
if (this.lastVisible) {
var start = this.lastVisible.expire_date
var query = games_ref.orderByChild('expire_date').startAfter(start).limitToFirst(this.item_limit)
await this.$bind("games", query)
this.setLastVisible()
}
}
Uncaught (in promise) TypeError: games_ref.orderByChild(...).startAfter is not a function
at _callee3$ (webpack-internal:///./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/views/GameBrowser.vue?vue&type=script&lang=js&:257)
at f (chrome-extension://bfnaelmomeimhlpmgjnjophhpkkoljpa/content_script/inpage.js:141)
at Generator._invoke (chrome-extension://bfnaelmomeimhlpmgjnjophhpkkoljpa/content_script/inpage.js:141)
at Generator.next (chrome-extension://bfnaelmomeimhlpmgjnjophhpkkoljpa/content_script/inpage.js:141)
at asyncGeneratorStep (webpack-internal:///./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:9)
at _next (webpack-internal:///./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:31)
at eval (webpack-internal:///./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:38)
at new Promise (<anonymous>)
at eval (webpack-internal:///./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js:27)
at VueComponent.seeFurtherGames (webpack-internal:///./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/views/GameBrowser.vue?vue&type=script&lang=js&:270)