[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
Dispatching an action synchronously in a guard leads to a loop.
No loop.
https://plnkr.co/edit/MNtybtGWdLg2e2dQu3EJ?p=preview
Watch the Console, while you click the link. NOTE: this causes a loop and will lag out your browser!

Dispatching the action will lead to this part of the router store that will check if a navigation is necessary. However, this.router.url will point to the old route, while this.storeState['routerReducer'].state.url will point to the new route. Therefore, routing is cancelled and the same route is activated again, the guard is triggered again and then you have a loop.
NPM 5.3
Browser: all
OS: all
node 6 LTS
ngrx 4.0.x
Same is happening for me. An action with type: ROUTER_CANCEL is being dispatched, then the infinite loop begins.
I had some problems with it. I resolved as I wrote it in the Issue #68.
However it should be nice to know which guard caused the cancellation to handle the redirecting properly.
@csutorasr this issue has nothing to do with guards cancelling anything as the guard just returns true.
Anyone have a workaround for this issue?
I kicked out router-store as it was not used very often in my project. The other "solution" I found was wrapping the dispatch in a timeout.
Both are not very solid solutions...
+1
There is another effect that is caused by the same mechanism:
If you have a canDeactivate guard and cancel route deactivation, then router-store will try to route you again.
A workaround for this issue is to change the name of the router slice to something other than routerReducer, like router. Router store only attempts to navigate when the state changes if the routerReducer key is present in the state and the URL doesn't match what's in the state.
Fixed via #355
Most helpful comment
Same is happening for me. An action with type: ROUTER_CANCEL is being dispatched, then the infinite loop begins.