René's URL Explorer Experiment


Title: Leading slash added to baseHref · Issue #32030 · angular/angular-cli · GitHub

Open Graph Title: Leading slash added to baseHref · Issue #32030 · angular/angular-cli

X Title: Leading slash added to baseHref · Issue #32030 · angular/angular-cli

Description: 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 20.3.11 Description Expected behavior The value of the href attribute of the ta...

Open Graph Description: 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 20.3.11 Description Expected behavior The valu...

X Description: 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 20.3.11 Description Expected behavior The valu...

Opengraph URL: https://github.com/angular/angular-cli/issues/32030

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Leading slash added to baseHref","articleBody":"### Command\n\nbuild\n\n### Is this a regression?\n\n- [x] Yes, this behavior used to work in the previous version\n\n### The previous version in which this bug was not present was\n\n20.3.11\n\n### Description\n\n**Expected behavior**\n\nThe value of the `href` attribute of the `\u003cbase\u003e` tag in the built `index.html` file should start with what's defined in the `baseHref` property of the builder.\n\n**Actual behavior**\n\nA leading `/` is added when the `baseHref` value does not start with one.\n\n**Impact**\n\nWe package our built apps inside docker images that process the `index.html` file on startup to replace certain strings matching `${...}` with values from environment variables.  This allows us to deliver portable docker images that can be deployed under different paths in different environments by simply setting the `BASE_HREF` environment variable.\n\nSo when building our app, we set `baseHref` in the build config to a string like `${BASE_HREF}`.\n\nWith Angular 20.3.11, this produced the following tag in `index.html` (with a localized build):\n\n```html\n\u003cbase href=\"${BASE_HREF}/en/\"/\u003e\n```\n\nSince Angular 20.3.13, we now get a leading slash added:\n\n```html\n\u003cbase href=\"/${BASE_HREF}/en/\"/\u003e\n```\n\nFor deployments where our `BASE_HREF` value is an empty string, this results in the base href value of `//en/` which is a protocol-relative URL and so all of our resources fail to load.\n\n### Minimal Reproduction\n\nCreate an Angular app with 20.3.13, set baseHref to a value that does not start with `/`, enable localization, build.\n\n### Exception or Error\n\n```text\n\n```\n\n### Your Environment\n\n```text\nAngular CLI: 20.3.13\nNode: 22.14.0\nPackage Manager: npm 10.9.2\nOS: darwin arm64\n    \n\nAngular: 20.3.15\n... animations, common, compiler, compiler-cli, core, forms\n... language-service, localize, platform-browser\n... platform-browser-dynamic, router\n\nPackage                      Version\n------------------------------------\n@angular-devkit/architect    0.2003.13\n@angular-devkit/core         20.3.13\n@angular-devkit/schematics   20.3.13\n@angular/build               20.3.13\n@angular/cdk                 20.2.14\n@angular/cli                 20.3.13\n@schematics/angular          20.3.13\nrxjs                         7.8.1\ntypescript                   5.9.3\nzone.js                      0.15.1\n```\n\n### Anything else relevant?\n\n_No response_","author":{"url":"https://github.com/daiscog","@type":"Person","name":"daiscog"},"datePublished":"2025-12-04T18:54:59.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/32030/angular-cli/issues/32030"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:a92d0fbf-6c54-b222-102a-321f5b4263bf
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id829C:363F36:3A7DA99:4D9EFC3:6964BAEC
html-safe-noncea818dacfdb16225afdf8cb11120ffcdec3e2bdbe6936a6bf61ba02cb0108635d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MjlDOjM2M0YzNjozQTdEQTk5OjREOUVGQzM6Njk2NEJBRUMiLCJ2aXNpdG9yX2lkIjoiMjY1MTU1NzM4NDA0MjEwMTQ4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacfd89de78852c7233f5b9156b90e790fde7573f7e0d7f15a0e00388f505caf821
hovercard-subject-tagissue:3696042910
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/32030/issue_layout
twitter:imagehttps://opengraph.githubassets.com/eae0f5c2a6eefd0ba81197a47ef7e205400810b7d3aae7434134352c7c53dfea/angular/angular-cli/issues/32030
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/eae0f5c2a6eefd0ba81197a47ef7e205400810b7d3aae7434134352c7c53dfea/angular/angular-cli/issues/32030
og:image:altCommand 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 20.3.11 Description Expected behavior The valu...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedaiscog
hostnamegithub.com
expected-hostnamegithub.com
None9917306ebdf5f9f30d13ede7b74f08a45b5f12b401ce3e4bfabd895ea0ca0ada
turbo-cache-controlno-preview
go-importgithub.com/angular/angular-cli git https://github.com/angular/angular-cli.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id36891867
octolytics-dimension-repository_nwoangular/angular-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id36891867
octolytics-dimension-repository_network_root_nwoangular/angular-cli
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release020ceddb26807bba62dcfb410905847d63243ff5
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/angular/angular-cli/issues/32030#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F32030
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F32030
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular-cli
Reloadhttps://github.com/angular/angular-cli/issues/32030
Reloadhttps://github.com/angular/angular-cli/issues/32030
Reloadhttps://github.com/angular/angular-cli/issues/32030
angular https://github.com/angular
angular-clihttps://github.com/angular/angular-cli
Notifications https://github.com/login?return_to=%2Fangular%2Fangular-cli
Fork 11.9k https://github.com/login?return_to=%2Fangular%2Fangular-cli
Star 27k https://github.com/login?return_to=%2Fangular%2Fangular-cli
Code https://github.com/angular/angular-cli
Issues 264 https://github.com/angular/angular-cli/issues
Pull requests 24 https://github.com/angular/angular-cli/pulls
Actions https://github.com/angular/angular-cli/actions
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/angular/angular-cli/security
Please reload this pagehttps://github.com/angular/angular-cli/issues/32030
Insights https://github.com/angular/angular-cli/pulse
Code https://github.com/angular/angular-cli
Issues https://github.com/angular/angular-cli/issues
Pull requests https://github.com/angular/angular-cli/pulls
Actions https://github.com/angular/angular-cli/actions
Security https://github.com/angular/angular-cli/security
Insights https://github.com/angular/angular-cli/pulse
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/32030
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/32030
Bughttps://github.com/angular/angular-cli/issues?q=type:"Bug"
#32040https://github.com/angular/angular-cli/pull/32040
Leading slash added to baseHrefhttps://github.com/angular/angular-cli/issues/32030#top
#32040https://github.com/angular/angular-cli/pull/32040
angular/build:applicationhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22angular%2Fbuild%3Aapplication%22
area: @angular/buildhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40angular%2Fbuild%22
freq1: lowOnly reported by a handful of users who observe it rarelyhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22freq1%3A%20low%22
severity5: regressionhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22severity5%3A%20regression%22
type: bug/fixhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
https://github.com/daiscog
https://github.com/daiscog
daiscoghttps://github.com/daiscog
on Dec 4, 2025https://github.com/angular/angular-cli/issues/32030#issue-3696042910
angular/build:applicationhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22angular%2Fbuild%3Aapplication%22
area: @angular/buildhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40angular%2Fbuild%22
freq1: lowOnly reported by a handful of users who observe it rarelyhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22freq1%3A%20low%22
severity5: regressionhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22severity5%3A%20regression%22
type: bug/fixhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
Bughttps://github.com/angular/angular-cli/issues?q=type:"Bug"
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.