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

Using URL with protocol as baseHref during build removes one slash while using the --localize option #17029

Closed
1 of 15 tasks
PierreDuc opened this issue Feb 20, 2020 · 1 comment · Fixed by #17030
Closed
1 of 15 tasks
Assignees
Labels
area: devkit/build-angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Milestone

Comments

@PierreDuc
Copy link

PierreDuc commented Feb 20, 2020

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • e2e
  • test
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

The localize option was not available yet

Description

Adding a full URL (https://path.to.assets.app.com) as baseHref to the build command in combination with the --localize removes one slash, resulting the base href in the index.html to be:

<base href="https:/path.to.app.com/{language_code}">

This will fail, because the assets will be loaded from a relative url, with this base href appended to it, which is not very nice

🔬 Minimal Reproduction

Create an app with localization configured, and run the build command:

ng build --baseHref=https://path.to.assets.app.com --prod --localize

🌍 Your Environment


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

Angular CLI: 9.0.2
Node: 12.13.0
OS: win32 x64

Angular: 9.0.1
... animations, common, compiler, compiler-cli, core, elements
... forms, language-service, platform-browser
... platform-browser-dynamic, router, service-worker
Ivy Workspace: Yes

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.900.2
@angular-devkit/build-angular      0.900.2
@angular-devkit/build-webpack      0.900.2
@angular-devkit/core               9.0.2
@angular-devkit/schematics         9.0.2
@angular/cdk                       9.0.0
@angular/cli                       9.0.2
@angular/fire                      6.0.0-rc.1
@angular/flex-layout               9.0.0-beta.29
@angular/localize                  9.0.2
@angular/material                  9.0.0
@angular/material-moment-adapter   9.0.0
@ngtools/webpack                   9.0.2
@schematics/angular                9.0.2
@schematics/update                 0.900.2
rxjs                               6.5.4
typescript                         3.7.5
webpack                            4.41.2
@alan-agius4 alan-agius4 added area: devkit/build-angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix labels Feb 20, 2020
@ngbot ngbot bot added this to the Backlog milestone Feb 20, 2020
@alan-agius4 alan-agius4 self-assigned this Feb 20, 2020
dgp1130 pushed a commit that referenced this issue Feb 24, 2020
…ze option

`posix.join` will dedupe double forward slashes resulting in incorrect protocol.

Closes: #17029
dgp1130 pushed a commit that referenced this issue Feb 24, 2020
…ze option

`posix.join` will dedupe double forward slashes resulting in incorrect protocol.

Closes: #17029
(cherry picked from commit 4e65705)
@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 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: devkit/build-angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants