You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Angular Router throwing error when compiling. Angular v.22.22.1 #34249
Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
Working with Angular standalone components. My app is set up to use Router Outlet for navigation; i have injected it into the main app component for the angular project. I have defined my routes and they work. I have added a new route/component to the pre-existing routes/component that loads onInit of the angular application. This new component imports and uses Router for navigation. The compiler throws the error: [ERROR] NG2012: Component imports must be standalone components, directives, pipes, or must be NgModules. Going back to the .ts file for the entry component and saving the files fixe the error, but prevents entry component from displaying.
Entry component displaying correctly without errors before integrating Router:
Error shown after incorporating Router:
Webpage shown after saving component's ts file; Entry comoponent no longer showing:
It seems to be an error during compiling. All the other routes that have been defined still work correctly. What is the cause of this one particular route's defect?
Hello, we reviewed this issue and determined that it doesn't fall into the bug report or feature request category. This issue tracker is not suitable for support requests, please repost your issue on StackOverflow using tag angular.
If you are wondering why we don't resolve support issues via the issue tracker, please check out this explanation.
(Imports are not for providers - the compiler error seems pretty clear)
Activity
atscott commentedon Oct 3, 2026
Hello, we reviewed this issue and determined that it doesn't fall into the bug report or feature request category. This issue tracker is not suitable for support requests, please repost your issue on StackOverflow using tag
angular.If you are wondering why we don't resolve support issues via the issue tracker, please check out this explanation.
(Imports are not for providers - the compiler error seems pretty clear)