Skip to content

Prerender generates wrong path for routes from routesFile if baseHref contains host #29860

Open
@constantant

Description

@constantant

Which @angular/* package(s) are the source of the bug?

router, Don't known / other

Is this a regression?

Yes

Description

I try to prerender a web app which uses CDN for the static files so document.baseURI and APP_BASE_HREF are different and document.baseURI looks like https://aws-blablabla.com/version-0001/build-0002/.

For the discovered routes everything works fine but if I need to indicate the dynamic ones it generates the wrong path like https:/ aws-blablabla.com/ version-0001/ build-0002/ dynamic/ path/ 01/ but it must be dynamic/ path/ 01/

Please provide the environment you discovered this bug in (run ng version)

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

Angular CLI: 19.2.1
Node: 20.14.0
Package Manager: npm 9.6.2
OS: win32 x64

Angular: 19.2.1
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, platform-server, router, ssr

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.1902.1
@angular-devkit/build-angular      19.2.1
@angular-devkit/core               19.2.1
@angular-devkit/schematics         19.2.1
@angular/cdk                       19.2.2
@angular/components-examples       19.2.0-next.4+sha-c40c701
@angular/google-maps               19.2.2
@angular/material                  19.2.2
@angular/material-experimental     19.2.2
@angular/material-moment-adapter   19.2.2
@angular/youtube-player            19.2.2
@schematics/angular                19.0.4
ng-packagr                         19.0.1
rxjs                               7.8.1
typescript                         5.6.3
zone.js                            0.15.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: repro stepsWe cannot reproduce the issue with the information given

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions