-
-
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
Fix undefined route info error #19417
Fix undefined route info error #19417
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm vaguely worried about adding this sort of guard because it often covers up other underlying problems. Do you know why the value was undefined
? Can you add a test that previously failed and now passes?
@rwjblue I'll look into it. There are some open issues mentionning this this Type Error, and currently there is an other spot in the router where we do this kind of check:
Thinking a bit about it, I can't see a legit case where the RouteInfos can be empty (maybe I misunderstand this thing, but for me that would mean there is no (active ?) route at all, which would be very surprising. (except maybe during the initial transition ?) I don't know if I'm clear in this description, but in all cases, naively I thought after setupRouter(), there was at least one RouteInfo, the one concerning the ApplicationRoute. @dmytro-krekota Can you describe the scenario where that error pops up ? Currently, this issue makes me think at this one: #11563 |
@dmytro-krekota there has been (hopefully) some improvements in the router area, landed in 3.24.3 and 3.25.3. So maybe this is it ? |
@sly7-7 no, I use the 3.12.0 version. Maybe updating can help to fix it. |
I'm confused here, you can't reproduce it even in your app on ember 3.12.0 version ? |
@sly7-7 yes. |
Ok, so what about letting you some time to try to reproduce ? If it appears the issue is gone, could you then close this issue ? |
Thank you @dmytro-krekota :) I'm assuming that's a good news, since you initial issue seems resolved, right ? |
I'm seeing the originally reported/fixed issue on this PR after upgrading ember from 3.25.0 to 3.26.1 and using the Router service to call
When I debug that stack, the new Note, I only see this issue in tests. |
I spoke too soon in my previous comment. After upgrading, I'm not occasionally seeing this error in my app too, not just in tests. In the app, the source of the error is empty routeInfos on the Transition in the Route model hook: |
It is for fixing an error which I faced:
TypeError: Cannot read property 'name' of undefined