Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task done
rdamazio opened this issue Feb 8, 2025 · 1 comment · Fixed by #29594
Closed
1 task done

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

rdamazio opened this issue Feb 8, 2025 · 1 comment · Fixed by #29594
Assignees
Labels
area: @angular/ssr freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix

Comments

@rdamazio
Copy link

rdamazio commented Feb 8, 2025

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

rdamazio added a commit to rdamazio/efis-editor that referenced this issue Feb 8, 2025
@alan-agius4 alan-agius4 added type: bug/fix freq1: low Only reported by a handful of users who observe it rarely severity5: regression area: @angular/ssr labels Feb 10, 2025
@alan-agius4 alan-agius4 self-assigned this Feb 10, 2025
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Feb 10, 2025
Enhances handling of `baseHref` when it includes a full URL with a protocol.

Closes angular#29590
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Feb 10, 2025
Enhances handling of `baseHref` when it includes a full URL with a protocol.

Closes angular#29590
dgp1130 pushed a commit that referenced this issue Feb 10, 2025
Enhances handling of `baseHref` when it includes a full URL with a protocol.

Closes #29590

(cherry picked from commit 833dc98)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @angular/ssr freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants