Skip to content

[esbuild] ng serve fails to load app if url parameter contains a dot (.) #26320

@bagbag

Description

@bagbag

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

v16 (with webpack), v17 configured with builder browser (webpack) works too

Description

If I open a route with a parameter that contains a dot I get a 404 response with an empty body.
With v16 and webpack this worked fine. If I remove the dots the route loads as expected.

Similar issue from old days: angular/angular#8249

Minimal Reproduction

ng new test
cd test/src/app
ng g c reset-password

export const routes: Routes = [
  {
    path: 'reset-password',
    children: [
      {
        path: ':token',
        component: ResetPasswordComponent
      }
    ]
  }
];

ng serve

open URL: http://localhost:4200/reset-password/abc -> works
open URL: http://localhost:4200/reset-password/abc.def -> fails (empty page)

Exception or Error

No response

Your Environment

Node.js version v21.1.0 detected.
Odd numbered Node.js versions will not enter LTS status and should not be used for production. For more information, please see https://nodejs.org/en/about/previous-releases/.

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 17.0.0
Node: 21.1.0 (Unsupported)
Package Manager: npm 10.2.3
OS: linux x64

Angular: 17.0.2
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
... service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1700.0
@angular-devkit/build-angular   17.0.0
@angular-devkit/core            17.0.0
@angular-devkit/schematics      17.0.0
@angular/cdk                    17.0.0
@angular/cli                    17.0.0
@angular/material               16.2.12
@schematics/angular             17.0.0
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.2
    
Warning: The current version of Node (21.1.0) is not supported by Angular.

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions