TypeError: Cannot read property 'component' of null
See original GitHub issueI’m submitting a…
[ ] 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 => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
We have the following route path:
http://www.test.com/App/12/Customer/Products
where 12 is the contract id of the customer. It’s a valid id.
Once we pass an id, which does not exist, we show the default id, but then we get the following exception, even tho the app still works and is functional:
This happens in app.component.ts
when navigating with: this.router.navigate
We do this navigation in the ngOnInit
, because we need to retrieve the contractId
of the current logged in user via http get
and set this id in the router.
Expected behavior
Not to have this error:
In:
this.canDeactivateChecks.push(new CanDeactivate(outlet.component, curr));
I also can not identify the origin of the error as it’s not showing in the stack.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
TypeError: Cannot read property 'component' of null - Stack ...
Is it possible one of your components you are pulling into your routes file is incorrect? maybe it is being imported from the...
Read more >"TypeError: Cannot read property 'Components' of null" - vue-cli
Hi Chris, the problem is the <template> is accessing the Components property of the info object before it's set by the response from...
Read more >TypeError: Cannot read property 'Component' of null #7067
Describe the bug Created a Page type with a dynamic zone that (for now) just contains a rich text component. It works when...
Read more >How to Read React Errors (fix 'Cannot read property of ...
Cannot read property means the code was trying to read a property. This is a good clue! There are only a few ways...
Read more >typeerror can not read property x of null - YouTube
Join this channel to get access to perks:https://www.youtube.com/channel/UCoSpmr2KNOxjwE_B9ynUmig/joinMy GearCamera ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Your question sounds like a support request.
Please use the issue tracker only for bugs and feature requests.
Use gitter and StackOverflow for support request.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.