Aurelia 2 router - eager mode problem

Hi,

long story short - I’ve experienced a number of strange issues, mainly with route generation, especially regarding parametrized child routes - routes being generated in a strange manner with parameters in parentheses instead of route segments etc.

In the recent rc1 release, there is a new “eager” mode that I was intending to try, in order to hopefully resolve the problems.
However, it doesn’t seem to work well with multiple “empty” routes definitions, even if they’re on different nesting levels (details below).
The question is - is that a bug in the new router mode, or was I abusing the router unknowingly until eager mode revealed that?

The app has plenty of nested components with child routers, I’d say up to 4-5 levels deep. Each defines the default empty route as a fallback / default handler; when navigating (either from template or programatically) we usually just point to the root of the module, letting the empty route rule do the redirect to actual default component of the child router.

Error: Cannot add ambiguous route. The pattern ‘’ clashes with ‘locations’

Here’s the main router on the entrypoint component:

export class MyApp {
  public static routes = [
    { path: '', redirectTo: 'locations/list' },
    { id: 'locations', path: 'locations', component: LocationsModule},
  ];
}

and the Locations Module:

export class LocationsModule {
  public static routes = [
    { path: '', redirectTo: 'list' },
    { id: 'locations-list', path: 'list', component: LocationListPage, title: 'Location List' },
    { id: 'single-location', path: 'single/:id', component: SingleLocationPage, title: 'Location' },
  ];
}
1 Like