Skip to content

Using an absolute deployUrl breaks the 'scripts' bundle url in index.html #7650

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

Closed
deanfischer opened this issue Sep 11, 2017 · 2 comments · Fixed by #7661
Closed

Using an absolute deployUrl breaks the 'scripts' bundle url in index.html #7650

deanfischer opened this issue Sep 11, 2017 · 2 comments · Fixed by #7661

Comments

@deanfischer
Copy link

deanfischer commented Sep 11, 2017

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.4.1
node: 7.10.1
os: darwin x64
@angular/animations: 4.3.6
@angular/common: 4.3.6
@angular/compiler: 4.3.6
@angular/compiler-cli: 4.3.6
@angular/core: 4.3.6
@angular/forms: 4.3.6
@angular/http: 4.3.6
@angular/platform-browser: 4.3.6
@angular/platform-browser-dynamic: 4.3.6
@angular/router: 4.3.6
@angular/cli: 1.4.1
typescript: 2.2.2

Repro steps.

.angular-cli.json: (Note the absolute deployUrl with https://)

"apps": [
    {
      "root": "src",
      "outDir": "target/my-app",
      "deployUrl": "https://someplace.cloudfront.net",
      "assets": [],
      "index": "index.html",
      "main": "main.ts",
      "polyfills": "polyfills.ts",
      "tsconfig": "tsconfig.app.json",
      "styles": [
        "styles.css"
      ],
      "scripts": [
        "../node_modules/some-libs/file.js",
      ]
    }
  ]

After I run ng build --prod, index.html looks like this:

...

<body>
    <my-app></my-app>
    <script type="text/javascript" src="https://someplace.cloudfront.net/inline.6cca322f7e258972d83b.bundle.js"></script>
    <script type="text/javascript" src="https://someplace.cloudfront.net/polyfills.1f88e2c5c51b2654c108.bundle.js"></script>
    <!-- BROKEN starts with https:/ (one slash) instead of https:// -->
    <script type="text/javascript" src="https:/someplace.cloudfront.net/scripts.4b3dfabee60e0d1b2077.bundle.js"></script>
    <script type="text/javascript" src="https://someplace.cloudfront.net/vendor.7e4452b3f0246d32e944.bundle.js"></script>
    <script type="text/javascript" src="https://someplace.cloudfront.net/main.4f222f38a3c2a53f4f40.bundle.js"></script>
</body>

...

Desired functionality.

The script tag should start with https:// rather than https:/ <---- one slash not two

Mention any other details that might be useful.

Similar to #7628 which was fixed a couple of days ago with #7634

@hansl
Copy link
Contributor

hansl commented Sep 11, 2017

My bad, I know what the error is. I'll fix it right away. Thanks for reporting.

hansl added a commit to hansl/angular-cli that referenced this issue Sep 11, 2017
Using path.join removes duplicated slashes, like in https://. This code
is the correct version used in the original html-webpack-plugin.

Fixes angular#7650
hansl added a commit to hansl/angular-cli that referenced this issue Sep 11, 2017
Using path.join removes duplicated slashes, like in https://. This code
is the correct version used in the original html-webpack-plugin.

Fixes angular#7650
hansl added a commit to hansl/angular-cli that referenced this issue Sep 12, 2017
Using path.join removes duplicated slashes, like in https://. This code
is the correct version used in the original html-webpack-plugin.

Fixes angular#7650
hansl added a commit that referenced this issue Sep 13, 2017
Using path.join removes duplicated slashes, like in https://. This code
is the correct version used in the original html-webpack-plugin.

Fixes #7650
hansl added a commit that referenced this issue Sep 13, 2017
Using path.join removes duplicated slashes, like in https://. This code
is the correct version used in the original html-webpack-plugin.

Fixes #7650
dond2clouds pushed a commit to d2clouds/speedray-cli that referenced this issue Apr 23, 2018
Using path.join removes duplicated slashes, like in https://. This code
is the correct version used in the original html-webpack-plugin.

Fixes angular#7650
@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 Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants