-
-
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
[Bug] Transition to same route without parameters creates error Uncaught TypeError: routeInfos[(routeInfoLength - 1)] is undefined
when a queryParam
has default value null
#20701
Comments
If on the route you change from |
@kategengler |
@mkszepp Sorry forgot we did the one on Route too ... Try using the one off of |
@kategengler yes this works without any error in js, but When using |
'router:application' isn't a thing afaik, so that explains the You can also make your error go away with:
As the problem is trying to redirect into the same route you're already entering. |
Yes, checking if user is already on same route works and is fixing the problem, but if you want to reset all query paramenters on start you can't do it (i think we were doing for that) |
For info, the stack trace leads to this method: ember.js/packages/@ember/routing/router.ts Lines 1146 to 1152 in cca6965
|
🐞 Describe the Bug
When adding a
transitionTo
on higher router we get errorUncaught TypeError: routeInfos[(routeInfoLength - 1)] is undefined
.The error occures, when the default value from queryParameter is
null
.🔬 Minimal Reproduction
Example repo: https://github.com/mkszepp/ember-transition-bug
Create a new app with route named
base
and copy this code parts.It seems like router has problem with default value
null
, when the current route is the same.🌍 Environment
v5.8.0
(its also present in older versions)v18.19
➕ Additional Context
There is reported the same error in other cases with older versions.
https://github.com/emberjs/ember.js/issues?q=is%3Aissue+is%3Aopen+routeInfos%5B%28routeInfoLength+-+1%29%5D
The text was updated successfully, but these errors were encountered: