You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Bug] Transition to same route without parameters creates error Uncaught TypeError: routeInfos[(routeInfoLength - 1)] is undefined when a queryParam has default value null#20701
Open
mkszepp opened this issue
May 24, 2024
· 6 comments
'router:application' isn't a thing afaik, so that explains the undefined. router:main is definitely a private API -- I wanted you to try it for debugging purposes, but you could put it in your app if you wanted.
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)
🐞 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: