Aurelia-router dynamic path rest issue

I’m using a route with rest parameter, and when using navigateToRoute, the rest path parameter appears as a query parameter in url (i.e. http://localhost:8080/#/dynamic?path=asdf%2Fasfd%2Fasdf instead of http://localhost:8080/#/dynamic/asdf/asdf/asdf). I did notice this only happens if I use an array for the route config, one without the rest parameter so that navigation can still occur without it. Does anyone know if I’m missing something?

example route config:

{
  name: 'dynamic',
  route: ['dynamic', 'dynamic/*path'],
  moduleId: PLATFORM.moduleName('dynamic-route')
}

example navigateToRoute

navigate(path) {
  this.router.navigateToRoute('dynamic', {path});
}
1 Like

Maybe you can try:

{
  name: 'dynamic',
  route: 'dynamic/*path',
  moduleId: PLATFORM.moduleName('dynamic-route')
}

or

{
  name: 'dynamic',
  route: 'dynamic/:path?',
  moduleId: PLATFORM.moduleName('dynamic-route')
}