Skip to content
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-store crashing browser #199

Closed
chrisbenseler opened this issue Jul 27, 2017 · 1 comment
Closed

router-store crashing browser #199

chrisbenseler opened this issue Jul 27, 2017 · 1 comment

Comments

@chrisbenseler
Copy link

chrisbenseler commented Jul 27, 2017

I'm facing a problem with ngrx/router-store 4.0.0

I followed the guide
When I run the app in the browser (either Chrome and Firefox), when it loads, everything is ok. But when I change the url, navigating through the links from my templates, the browser crashes.

Any thoughts of what can be happening?

My StoreModule.forRoot(reducers) and StoreRouterConnectingModule are not in the main NgModule (from app.module.ts), but in another module.

My package.json with @angular and @ngrx dependencies:

"@angular/common": "^4.3.0",
"@angular/compiler": "^4.3.0",
"@angular/core": "^4.3.0",
"@angular/forms": "^4.3.0",
"@angular/http": "^4.3.0",
"@angular/platform-browser": "^4.3.0",
"@angular/platform-browser-dynamic": "^4.3.0",
"@angular/router": "^4.3.0",
"@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.29",
"@ngrx/core": "^1.2.0",
"@ngrx/effects": "^4.0.0",
"@ngrx/router-store": "^4.0.0",
"@ngrx/store": "^4.0.0",
"@ngrx/store-devtools": "^4.0.0",

PS: I noticed that the problems is within my guard.
Inside it I have a method that dispatch an action to an Effect. When this happens, the state is changed and then a loop occurs: the guard is called again, then the action is dispatched. Then the state changes. Then the guard is called again. And so on...
What I noticed, too, is that when I access any url (example: /contents/8888), the browser first hits the root (/) and then hits the desired route/url. I don't know if this happens because my /contents/ routes are lazy loaded.

@brandonroberts
Copy link
Member

Tracking this issue in #201

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants