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
models is undefined #12845
Comments
I made a pr which fixes this strange behavior. But I want to know why does that happen at all? |
Sounds like some kind of race-condition, if it doesn't happen consistently. |
We need to see a reproduction of this issue, the proposed fix is overly defensive and likely is just hiding some other issue (in ember or your app) |
I dont know if the stack trace helps..
|
Nope, we need a reproduction. |
@stefanpenner Could you provide some pointers? From where is the |
It would appear that their exists an application where this behavior is manifesting, extracting that part of the application would be a great starting point for a reproduction. Unfortunately, I am asking for a reproduction because I have no idea how this issue is happening. Without further context, this isn't actionable. So I am requesting more context, once provided I will happily dive in. |
Unfortunately I am not allowed to disclose the source code of our app (corporate policies). The app has grown so big, that I cannot easily just reproduce it. Especially since the API response appears to play an important role. I'll look into this in greater detail and will try to find cause. I'm now able to reliably trigger the error, however this only works in one of our dev VMs. All other machines don't appear to have a problem. I diffed the js assets and they are exactly the same on all machines. All machines run the same version of Linux and the same version for Firefox and chrome. |
@mohlek my guess, is that it isn't a bug in link-to rather a legit race condition in your app. That is just a gut feeling, but Is likely work further investigation. Maybe their is something we can do on our side (as link-to could totally use some more tlc), but that will require some guess/check. |
@mohlek I also work with code that may not be shared publicly but when I run in to a major bug in my app I try to reproduce an example code repository on github so the Ember contributors can reproduce my error and fix any potential bugs in the framework. I know it's a bit of work, but if you have no workaround that has been the best course of action for me. |
perhaps this issues is related #12969 |
The current Ember version 2.4.2 seems to fix my problem. However. Since this bug doesn't showed up for a while now (In version 2.4.2) I won't spend any further time on it. Thanks everyone for contribution |
Same issue here in 2.4.5. Having a tough time repro'ing outside our application, but same stack trace as @mohlek. |
So, I found that I had an "index" route that was redirecting to another route. I was not including the parent route's model in the transition. It worked some of the time, i.e.... // course/route.js
model() {
return this.store.findRecord('course', params.course_id);
} // course/index/route.js
beforeModel() {
this._super(...arguments);
this.transitionTo('course.curriculum');
} If I update beforeModel() {
this._super(...arguments);
const course = this.modelFor('course');
this.transitionTo('course.curriculum', course);
} |
I have another strange bug in ember.
Sometimes i get an error when switching routes.
TypeError: models is undefined.
This error doesn't happen all the times. And I can't reproduce it every time.
There is no way to reproduce it in a twiddle and my repo has to be private.
I could track that bug down to link-to but I don't know what triggers this sneaky bast***
Any ideas?
The text was updated successfully, but these errors were encountered: