question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'component' of null

See original GitHub issue

I’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:

image

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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
vicbcommented, Aug 3, 2017

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.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 14, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found