-
Notifications
You must be signed in to change notification settings - Fork 27k
Description
Describe the problem that you experienced
This error is printed in the console and can be more clear.
See the assertStandalone function:
https://github.com/angular/angular/blob/main/packages/router/src/utils/config.ts
The error told me to "Invalid configuration of route 'XYZ' The component must be standalone"
However, this would NOT fix my problem. The issue was not that my component MUST be standalone. Rather, I was using it in a non-standalone situation.
Enter the URL of the topic with the problem
https://github.com/angular/angular/blob/main/packages/router/src/utils/config.ts
Describe what you were looking for in the documentation
Describe in more detail 'standalone'. Perhaps say "This component is trying to be loaded as standalone but it is not marked as standalone. Did you mean to include it in a module?"
Describe the actions that led you to experience the problem
My issue is that I incorrectly used loadComponent instead of loadChildren which is an obvious mistake. However I likely did this because the two properties are named similar and did not present any type-safety problems.
Describe what you want to experience that would fix the problem
Better error messaging. Type Safety would be best.
Add a screenshot if that helps illustrate the problem
No response
If this problem caused an exception or error, please paste it here
{
path: 'protected',
canLoad: [OktaAuthGuard],
canActivate: [OktaAuthGuard],
loadComponent: () => import('./protected/protected.module').then((m) => m.ProtectedModule),
},
### If the problem is browser-specific, please specify the device, OS, browser, and version
_No response_
### Provide any additional information here in as much as detail as you can
_No response_