Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested RouteModule forChild calls #8

Open
billy-briggs-dev opened this issue Feb 5, 2022 · 0 comments
Open

Nested RouteModule forChild calls #8

billy-briggs-dev opened this issue Feb 5, 2022 · 0 comments

Comments

@billy-briggs-dev
Copy link

billy-briggs-dev commented Feb 5, 2022

I have situation where I am trying to chain a bunch of lazy-loaded routes with the forChild function. However after loading one of my lazy loaded modules, I get this route error in the browser when clicking on a link to a supposedly newly registered route:

ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'mfe3/b/c' Error: Cannot match any routes. URL Segment: 'mfe3/b/c'

This is the structure of my RouterModule reference calls in each module.

AppModule

RouterModule.forRoot([
    { matcher: endsWith('a'), component: AComponent },
    { matcher: endsWith('b'), loadChildren: () => import('./b/b.module').then(m => m.BModule)}
], { relativeLinkResolution: 'legacy' })

BModule

RouterModule.forChild([
  { matcher: endsWith(''), component: BComponent },
  { matcher: endsWith('c'),  loadChildren: () => import('./c/c.module').then(m => m.CModule)},
])

CModule

RouterModule.forChild([
    { matcher: endsWith(''), component: CComponent },
])

Is there a reason for why the CModule matcher isn't being registered in the Router? Any insight would really help me out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant