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
{{ message }}
Repository navigation
[Bug] Transition to same route without parameters creates error Uncaught TypeError: routeInfos[(routeInfoLength - 1)] is undefined when a queryParam has default value null #20701
'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)
Activity
kategengler commentedon Jun 5, 2024
If on the route you change from
this.router.transitionTotothis.transitionTo, does it work?mkszepp commentedon Jun 6, 2024
@kategengler
this.transitionTowithout router doesn't exists 😊. i think it was removed with ember v5 or?kategengler commentedon Jun 6, 2024
@mkszepp Sorry forgot we did the one on Route too ... Try using the one off of
router(not the same as RouterService) https://api.emberjs.com/ember/5.9/classes/EmberRouter/methods/transitionTo?anchor=transitionTo to see if the behavior is better -- you can get at it withgetOwner(this).lookup('router:main').transitionTo(...mkszepp commentedon Jun 7, 2024
@kategengler yes this works without any error in js, but
router:mainis private API, so we are getting this lint errorWhen using
getOwner(this).lookup('router:application').transitionTo('base');i'm getting errorundefined.kategengler commentedon Jun 7, 2024
'router:application' isn't a thing afaik, so that explains the
undefined.router:mainis definitely a private API -- I wanted you to try it for debugging purposes, but you could put it in your app if you wanted.You can also make your error go away with:
As the problem is trying to redirect into the same route you're already entering.
mkszepp commentedon Jun 7, 2024
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)
johanrd commentedon Nov 2, 2024
For info, the stack trace leads to this method:
ember.js/packages/@ember/routing/router.ts
Lines 1146 to 1152 in cca6965