-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
'Index out of range' error when transitioning between routes #10343
Comments
I had same issue. I loaded my |
Going over and re-doing everywhere we're using an |
ArrayController will be deprecated anyway so maybe it's better to refactor your application now than later. |
That is the plan, but I'd like to make sure that is actually the problem for other people's sake. I'm not super-familiar with the functions mentioned in the stack trace, but it looks pretty generic to reduce computed. (https://github.com/emberjs/ember.js/blob/beta/packages/ember-runtime/lib/computed/reduce_computed.js#L332) |
@kuzirashi, where are you seeing/hearing that ArrayController will be deprecated? I’ve fought tooth-and-nail with it in the past so this is interesting to me, but I can’t find anything about it on emberjs.com or otherwise. |
@andrewbranch https://gist.github.com/Kuzirashi/7f6016e426005146f593 I gathered some resources and created a gist. |
@kimroen can get an isolated example? Can you try on canary? |
@stefanpenner Like I said, I can't reliably reproduce it, so it's a bit tricky to tell if I've been able to isolate the problem. I can certainly try it with canary, but again I won't really be able to tell if it works. |
@kimroen not sure what time zone you are in, but I'll try to carve out some time to screen share with you. |
@stefanpenner I'll move mountains to make it work ;) Ping me on IRC or something? |
@kuzirashi Thanks! |
@stefanpenner I'm fairly certain this has to do with async property changes that come from setProperties + array proxies + reduce computed and is a duplicate of other issues. |
Are you using any reduce computed functions? If you're using |
ya that is also my suspicion. |
I'm coming across this error as well. I think my situation is pretty similar to @kimroen's. I'm using Ember 1.9.1. Here's my stack trace: Error while processing route: account.teachers.add Index out of range Error: Index out of range
at new Error (native)
at Error.EmberError (http://localhost:4200/assets/vendor.js:27294:23)
at Array.__exports__.default.Mixin.create.removeAt (http://localhost:4200/assets/vendor.js:45975:19)
at arrayComputed.removedItem (http://localhost:4200/assets/vendor.js:42236:17)
at Object.DependentArraysObserver.flushChanges (http://localhost:4200/assets/vendor.js:40913:40)
at Object.DependentArraysObserver.itemPropertyDidChange (http://localhost:4200/assets/vendor.js:40897:16)
at Object.DependentArraysObserver.createPropertyObserver.observerContext.observer (http://localhost:4200/assets/vendor.js:40764:41)
at apply (http://localhost:4200/assets/vendor.js:33209:27)
at sendEvent (http://localhost:4200/assets/vendor.js:27666:13)
at notifyObservers (http://localhost:4200/assets/vendor.js:31033:9) |
@elidupuis smells like RC/AC 🈂️ |
@stefanpenner awesome, thanks! Glad it's not just me hitting this error 😉 |
Just for the reference, the bug that is referred to above might be #5558 |
I believe I am getting this as well using the latest ember-cli... The scenario is as follows: I have a "master"-type route for members. I filter it down to one member. Click on the member to go to the "detail" route. When I click back - I get the error.
|
The error went away when I did the following instead
|
This bit us too, on Ember 1.10.0. We have an array of models we are using Ember.computed('[email protected]', function() {
return this.get('ourModels').sortBy('thatProperty');
}) |
Just encountered this too. In my case, I was using
Not proxying out
I noted, in particular, that my model for
Thus, other models that did not use |
…rjs#9462, emberjs#4919, emberjs#4231, emberjs#3706, emberjs#5596, emberjs#9485, emberjs#9492, emberjs#5319, emberjs#5268, emberjs#4831, emberjs#5558] Move away from AC/RC instead use the simpler naive enumerable methods, and rely on glimmers stable rendering for efficiency. For more complex scenarios, custom solutions should be used. @wagenet & @stefanpenner
The most common error in our Ember application is this one, which presumably happens when the user transitions out of one of our routes. This happens often in production, but much rarer in development, which tells me it might be due to the number of elements in the array(?).
I thought maybe it was this bug: #9278, but it still happens with the newest version of Ember (v1.9.1).
I don't have a reliable way of triggering the error, I just have to switch back and forth a lot.
Here is a stack trace:
I'm not sure where to start looking with this one.
The text was updated successfully, but these errors were encountered: