Skip to content

--base-href with full URL embedding it into paths #29590

Closed
@rdamazio

Description

@rdamazio

Command

build

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

19.1.4

Description

After upgrading to the latest version, my project is embedding the full URL passed to --base-ref into the generated file paths in the dist directory, as well as prerendered-routes.json.

A workaround is to only use a path instead of a full URL.

Minimal Reproduction

To reproduce:

$ ng new bugtest --ssr --style scss
$ cd bugtest
$ ng update @angular/core@19 @angular/cli@19
(just hit enter for each prompt)
$ ng build --configuration production --base-href https://foo.com/
$ find dist/bugtest/browser

Expected from last command:

dist/bugtest/browser
dist/bugtest/browser/index.html
dist/bugtest/browser/favicon.ico
dist/bugtest/browser/index.csr.html
dist/bugtest/browser/main-ZIKXCDM5.js
dist/bugtest/browser/styles-5INURTSO.css
dist/bugtest/browser/polyfills-FFHMD2TL.js

Actual:

dist/bugtest2/browser
dist/bugtest2/browser/https:
dist/bugtest2/browser/https:/foo.com
dist/bugtest2/browser/https:/foo.com/index.html
dist/bugtest2/browser/favicon.ico
dist/bugtest2/browser/index.csr.html
dist/bugtest2/browser/main-ZIKXCDM5.js
dist/bugtest2/browser/styles-5INURTSO.css
dist/bugtest2/browser/polyfills-FFHMD2TL.js

Additionally, I see:

$ cat dist/bugtest/prerendered-routes.json 
{
  "routes": {
    "/https:/foo.com": {}
  }
}

which doesn't look right.

Exception or Error


Your Environment

Node.js version v23.6.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: 19.1.6
Node: 23.6.0 (Unsupported)
Package Manager: npm 11.1.0
OS: darwin x64

Angular: 19.1.5
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1901.6
@angular-devkit/build-angular   19.1.6
@angular-devkit/core            19.1.6
@angular-devkit/schematics      19.1.6
@angular/cli                    19.1.6
@angular/ssr                    19.1.6
@schematics/angular             19.1.6
rxjs                            7.8.1
typescript                      5.5.4
zone.js                         0.15.0

Anything else relevant?

Real project/revision where I saw this:
https://github.com/rdamazio/efis-editor/tree/c64c14f82890cbc2b55c81df4d7f61723ffec22e

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions