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: Cannot read property '_outlets' of undefined #12634
Comments
Pls add a minimal working repro in plunkr. |
Having the same problem, happens when I am trying to navigate away from component-less route with |
have the same issue after yeasterdays update to latest angular version |
I can confirm that downgrading the router to 3.1.1 (leaving everything else intact, i.e. angular 2.1.2 with router 3.1.1) fixes the issue for me. Thanks @AlexMesser Hence it appears this is a regression which should be fixed ASAP @DzmitryShylovich . Repro: http://plnkr.co/edit/HSq837Eor1HQw2lkCO2V I was also able to reproduce a related issue ("Cannot read property 'canDeactivate' of null") in this modified tour of heroes example: http://plnkr.co/edit/ZpuYNYuRcug7etzA0TiR |
There was a commit after 2.1.2 release. |
@DzmitryShylovich can't test it in plunkr, apparently I get a CORS error from github. What's the system.js config I'd need to pass in? In any case, it's probably trivial for you to try it yourself. |
I couldn't get the router-builds repo to work in plunkr, but in my local code base. Using |
Forget what I just said, using the version specified above still produces the exact some error, but does no longer log it to console, wtf!? Registering a navigation event listener, I see this: |
I have the same error but I only get this error when I build my code in productive mode. In development mode everything works fine. |
without this check periodically, an error occurs as described in angular#12634
I believe this is fixed in v2.2.0 of angular (router 3.2.0 respectively). |
Yeah, cannot reproduce using plunkr from #12634 (comment) |
Thnx @JohannesRudolph and @DzmitryShylovich for confirming. Closing as fixed. |
I'm facing the same problem. I cannot navigate within The app still works, but I get the error thrown! That is my code inside let routerInitializerSubscriber = this.router.events.filter(event => event instanceof RoutesRecognized)
.subscribe((route: RoutesRecognized) => {
let contractId = route.state.root.firstChild ? Number(route.state.root.firstChild.paramMap.get(ROUTE_PARAM_KEYS.contractId)) : null;
this.contractService.getContracts()
.finally(() => routerInitializerSubscriber.unsubscribe())
.subscribe((contracts) => {
let contract = contracts.find(v => v.id === contractId);
this.contracts = contracts;
this.selectedContract = contract === undefined ? contracts[0] : contract;
this.router.navigate([`${this.selectedContract.id}/${this.locationService.getPath()}`], { queryParams: this.activatedRoute.snapshot.queryParams });
});
}); if I comment out my http request for |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a ... (check one with "x")
Current behavior
When switching routes I sometimes get the following error thrown by the router
Digging the source, it looks like there's a null reference check missing for
outlet.outletMap
here:Expected behavior
Uh, navigate without error!
Minimal reproduction of the problem with instructions
Unfortunately not yet a minimum repro, but my routing configuration looks like this:
The error occurs when navigating from ChildModule
/locations/xyz/child
to the/profile
route.Please tell us about your environment:
angular-cli: 1.0.0-beta.19-3
node: 6.3.0
os: darwin x64
Angular version: 2.1.2
router version "3.1.2"
Browser:
all
Language:
TypeScript 2.0.3
Node (for AoT issues):
node --version
=node: 6.3.0
The text was updated successfully, but these errors were encountered: