Description
Command
serve
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
18
Description
When the routing configuration contains a nested wildcard route and a redirect target and an non-nested wildcard route after the nested route that redirects to the nested route (see below), CommonEngine
will use the nested route while AngularNodeAppEngine
will use the non-nested route.
@Component({selector: 'test', template: 'test'})
class TestComponent {}
@Component({selector: 'not-found', template: '404 not found'})
class NotFoundComponent {}
export const routes: Routes = [
{
path: '',
children: [
// AngularNodeAppEngine will end up following the redirect and rendering this route
{
path: 'not-found',
component: NotFoundComponent
},
// CommonEngine will just simply render this route
{
path: '**',
component: TestComponent
},
]
},
// AngularNodeAppEngine chooses this route
{
path: '**',
redirectTo: 'not-found'
},
]
Is this intended behavior? It seems that the vite dev server follows the behavior of AngularNodeAppEngine
and is blocking us from upgrading to v19.
Something odd is that AngularNodeAppEngine
will render /
as test
but /asdfasdf
as 404 not found
. CommonEngine
renders test
for both of these paths.
Some debugging found that
is likely to blame. It flattens the route tree in a way that the nested wildcard route gets overridden by the non-nested one during the insert into the final route treeMinimal Reproduction
AngularNodeAppEngine
- https://github.com/griest024/ng19-server-routing
CommonEngine
- https://github.com/griest024/ng19-server-routing/tree/common-engine
- run
npx ng b && npm run serve:ssr:19-dev-server-routes
- navigate to
/asdfasdfasdf
or any other route that is not/
or/not-found
- See that the rendered component is different.
Exception or Error
Your Environment
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 19.1.5
Node: 18.20.5
Package Manager: npm 10.8.2
OS: linux x64
Angular: 19.1.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1901.5
@angular-devkit/build-angular 19.1.5
@angular-devkit/core 19.1.5
@angular-devkit/schematics 19.1.5
@angular/cli 19.1.5
@angular/ssr 19.1.5
@schematics/angular 19.1.5
rxjs 7.8.1
typescript 5.6.3
zone.js 0.15.0
Anything else relevant?
No response