question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: infinityModel.pushObjects is not a function

See original GitHub issue

I use Ember 2.4.1 with ember-data 2.4.0 I have a problem when I use RSVP hash as a route model:

return Ember.RSVP.hash({
      feed: this.store.findRecord('rssfeed', params.feed_id),
      items: this.infinityModel('rssitem', {
        perPage: 5,
        startingPage: 1,
        filter: {
          feed: params.feed_id
        }
      })
    });

Initial loading works fine but I have an error on update:

ember.debug.js:32123 TypeError: infinityModel.pushObjects is not a function
    at _doUpdate (route.js:308)
    at _nextPageLoaded (route.js:329)
    at route.js:246
    at tryCatch (ember.debug.js:53542)
    at invokeCallback (ember.debug.js:53557)
    at publish (ember.debug.js:53525)
    at ember.debug.js:32081
    at Queue.invoke (ember.debug.js:333)
    at Object.Queue.flush (ember.debug.js:397)
    at Object.DeferredActionQueues.flush (ember.debug.js:205)

I can see that infinityModel.pushObjects is undefined in route.js:308:

    _doUpdate: function _doUpdate(newObjects) {
      var infinityModel = this._infinityModel();
      return infinityModel.pushObjects(newObjects.get('content'));
    },

How can I solve the problem?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
JLin37commented, May 27, 2016

@hhff Thank you so much, that worked great.

1reaction
hhffcommented, May 27, 2016

try this @JasonLin37

setupController(controller, model) {
  controller.set('listings', model.listings);
},
Read more comments on GitHub >

github_iconTop Results From Across the Web

pushobject is not a function emberjs - Stack Overflow
You have a typo. You're pushing to the actual model instead of the books hasMany relationship: actions: { addCollection(model) { model.
Read more >
https://raw.githubusercontent.com/ember-infinity/e...
pushObjects is not a function ... Uncaught TypeError: Cannot read property 'offset' of undefined ... "Could not fetch Infinity Model" masks other errors ......
Read more >
Safari TypeError: 'undefined' is not a function (evaluating ...
I have a piece of code in angular2 with TypeScript in which on change of select box dropdown, html table data changes.
Read more >
ember-infinity - npm
Simple, flexible infinite scroll for Ember CLI Apps.. Latest version: 2.3.0, last published: a year ago. Start using ember-infinity in your ...
Read more >
Top 5 ember-infinity Code Examples - Snyk
import Route from '@ember/routing/route'; import InfinityModel from ... afterInfinityModel(newObjects/*, infinityModel*/) { // smoke test. not really doing ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found