-
-
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
Router Service transitionTo breaks with Query Params on nested transition #17494
Comments
I have a similar error when trying to make transitionTo() into model(){}
|
I'm also seeing the problem.
this.get('router').transitionTo('reports.report', report_id, {
queryParams: {
startDate: startDate.format('DD-MM-YYYY'),
endDate: endDate.format('DD-MM-YYYY')
}
});
I was able to track the problem up to this point: Was able to reproduce this on ember 3.3.2, 3.4.8, 3.5.1, 3.6.1 and 3.7. Weird thing is that it works with the router's |
This is still an issue with Ember 3.8.2 |
I ran into this issue as well - good to know that it is scoped just to the router service. |
ember-source 3.8.1 + ember-simple-auth >= 1.9.0 Problem occurs with an unauthenticated redirect ( ember-source 3.12.0 throws an error as in #14875 (comment) |
Hit this today, |
I was thinking that this is fixed in 3.14 by #18244, anyone have a minute to try to confirm / deny? |
We were able to temporarily fix this using RouterService#urlFor method: Controller.extend({
router: service(),
actions: {
moveUser() {
// before:
this.get('router').transitionTo(routeName, routeParamOne, routeParamTwo);
// after:
this.customTransition(routeName, routeParamOne, routeParamTwo);
}
},
customTransition(...params) {
const url = this.get('router').urlFor(...params); // build url first
this.get('router').transitionTo(url); // and make transition
// And if you need to preserve query params, I guess you can use `window.location.search` and add this to url like:
this.get('router').transitionTo(url + window.location.search);
}
}) |
Feels like a hack, but works like a charm. Good enough for me until version update |
In case it's helpful, here's a really minimal repro in a twiddle. |
I am seeing this issue in ember-source@3.16.7 |
Ran into this just now as well. Have seen it intermittently previously. The ESA link seems likely |
Hi all, I've taken @bendemboski twiddle, and created a repository to see what happen against 3.25.1. Unless I'm missing something it seems like this issue is resolved. This would be great if someone could double check. https://github.com/sly7-7/repro-ember-17494 @jtescher Obviously, if you had a chance to update your app and see how it goes, it would be an super feedback :) cc/ @rwjblue |
The bug is still present in ember version 3.28 and 4.3. When I use the The workaround from @kbiedrzycki (#17494 (comment)) still works on version 3.28 and 4.3. |
We're hitting an issue, which I think may be related to this bug. Query params always show up on the child route, even though we are not setting values for them, so the defaults should be hidden. |
@RobbieTheWagner Have you seen #19492 and #19493 ? |
Thanks @kategengler! |
Calling
transitionTo
on a service in the context of an existing transition causes an assertion error to be thrown.Example Twiddle here
Minimal logic from the reproduction above is: index route's
beforeModel
calls the auth service'sensureSignedIn
method which uses the router'stransitionTo
method and includes a query param.Calling it results in:
The text was updated successfully, but these errors were encountered: