Skip to content

deploy-url does not change path of scripts with ng serve #11952

Closed

Description

@lucboutier

Bug Report or Feature Request (mark with an x)

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

Command (mark with an x)

- [ ] new
- [ ] build
- [x ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

node --version v8.9.4
npm --version 5.6.0
ng --version

 _                      _                 ____ _     ___
/ \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|

/ △ \ | '_ \ / | | | | |/ _ | '__| | | | | | |
/ ___ | | | | (
| | || | | (| | | | || | | |
// __| ||_, |_,||_,|| _|||
|___/

Angular CLI: 6.1.2
Node: 8.9.4
OS: darwin x64
Angular: 6.0.6
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.6.8
@angular-devkit/build-angular 0.6.8
@angular-devkit/build-optimizer 0.6.8
@angular-devkit/core 0.3.2
@angular-devkit/schematics 0.7.2
@angular/cdk 6.3.0
@angular/cli 6.1.2
@angular/material 6.3.0
@ngtools/webpack 6.0.8
@schematics/angular 0.7.2
@schematics/update 0.7.2
rxjs 6.2.1
typescript 2.7.2
webpack 4.12.0

macOS High Sierra

Repro steps

ng serve --deploy-url /

<script type="text/javascript" src="runtime.js"></script>

I would have expected to see

<script type="text/javascript" src="https://github.com/runtime.js"></script>

Mention any other details that might be useful

I am using currently the base tag that was working fine for me until I included some SVG clip-mask that reference definitions using the url(#def-id) which is the way to go using SVG but does not work well with base url definitions.

I was thinking that I could solve this using the APP_BASE_HREF variable but then I ran in an issue when using live reload for dev purpose, the url that I edit is often something different than the root and so relative script urls like <script type="text/javascript" src="runtime.js"></script> just causes not found issues.

I found that deploy-url could be used to change the scripts url, which worked fine using ng build, but failed using ng serve. deploy-url is however documented for the ng serve command, I am not sure what it does in this context.

Thanks for your help.

Activity

  1. added this to the needsTriage milestone on Aug 20, 2018
  2. modified the milestones: needsTriage, Backlog on Aug 24, 2018
  3. feng-xiao commented on Sep 17, 2018

    @feng-xiao

    @filipesilva when can it be fixed? we need to send --deploy-url value from command line to override the settings in angular.json.

  4. jtal commented on Sep 19, 2018

    @jtal

    Sorry if this isnt related. But, if it is, there is a workaround at the bottom.

    #12281

  5. added a commit that references this issue on Sep 27, 2018
    d582d80
  6. added a commit that references this issue on Oct 6, 2018
    4c73ce8
  7. angular-automatic-lock-bot commented on Sep 8, 2019

    @angular-automatic-lock-bot

    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.

  8. locked and limited conversation to collaborators on Sep 8, 2019
  9. added a commit that references this issue on May 29, 2026
    9f54243
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions