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.

"not a known element" errors with shallow-render 8.2.0 when defining in "entryComponents"

See original GitHub issue

After updating my project to Angular 8 I updated shallow-render to 8.2.2. After doing so my tests fail, both with an unknown element error:

Simply from my app module that imports an app routing module (which itself imports RouterModule):

	1. If 'router-outlet' is an Angular component, then verify that it is part of this module.
	Error: Template parse errors:
	'router-outlet' is not a known element:

This is from a component that uses the PrimeNG library (where ‘p-table’ comes from):

	1. If 'p-table' is an Angular component and it has 'columns' input, then verify that it is part of this module.
	2. If 'p-table' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

In both of these cases there is no issue running ng serve or e2e tests which go through both of these modules.

In order to try to create a minimal repro I attempted to fork your Stackblitz Playground and update the Angular 8, and many of your tests fail: https://stackblitz.com/edit/shallow-render-ng8?file=package.json – note that the failures still occur with non-Angular deps at the previous versions, I only upgraded them to see if it resolved the failures.

Can you advise on whether or not the Stackblitz is set up properly? Perhaps there is something I’m missing w.r.t. Angular 8 compatibility in my own app.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
antchcommented, Aug 2, 2019

Works perfectly.

1reaction
getsafcommented, Aug 2, 2019

👍

Give v8.3.0 a go and see if it fixes your issue. Please report back if you still have issues!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 2 'component' is not a known element - Stack Overflow
I get the following error though: "Uncaught (in promise): Error: Template parse errors: 'contacts-box' is not a known element: If ' ...
Read more >
NG8001: Unknown HTML element or component - Angular
One or more elements cannot be resolved during compilation because the element is not defined by the HTML spec, or there is no...
Read more >
mdb-error is not a known element?
ERROR in : 'mdb-error' is not a known element: 1. If 'mdb-error' is an Angular component, then verify that it is part of...
Read more >
Ionic4 component not a known element - Ionic Framework
Hi guys, I've looked around but it seems I have all bases covered. Here's a repro: create an example project ionic start example ......
Read more >
Angular Error NG8001: is not a known element ... - YouTube
https://readdy.net/Notes/Details/1827Angular Error NG8001: 'mat-progress-spinner' is not a known element :Angular Error is an Angular ...
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