facebook

Console+ / GitBash bug (ng build –base-href=/some-context-root/)

  1. MyEclipse IDE
  2.  > 
  3. Off Topic

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #525029 Reply

    Claudio Trajtenberg
    Participant

    Running ng build –base-href=/some context root yields a local path in the index.html file.

    Configuration:

    node: 7.10.0
    os: win32 x64
    @angular/common: 4.1.3
    @angular/compiler: 4.1.3
    @angular/core: 4.1.3
    @angular/forms: 4.1.3
    @angular/http: 4.1.3
    @angular/platform-browser: 4.1.3
    @angular/platform-browser-dynamic: 4.1.3
    @angular/router: 4.1.3
    @angular/cli: 1.0.6
    @angular/compiler-cli: 4.1.3

    reproduction steps:

    1. Create a simple project
    2. run ng build –base-href=/some-context-path/

    Yields <base href="C:/Program Files/Git/test/"> in the <head>

    I tested with cygwin bash and Windows cmd and the command works properly

    The issue has been discussed at angular cli github

    Workaround run the command in a regular console using Local Terminal (Windows cmd) you will have to cd to your project location

    #525065 Reply

    support-piotr
    Participant

    Claudio,

    Thanks for letting us know about this problem. Terminal+ has to work with git bash for various reasons and there is nothing we can do about this issue. Fortunately, there is a simple workaround with specifying root with double slash, as stated by Filipe Silva. Please let us know if it works for you.

    #525089 Reply

    Claudio Trajtenberg
    Participant

    Piotr,

    Unfortunately the //test/ solution does not work it yields `<base href=”//test/”> which is interpreted as top level, protocol agnostic, URI

    From Chrome console:

    GET http://a2-struts/js/inline.bundle.js net::ERR_NAME_NOT_RESOLVED
    index:13 GET http://a2-struts/js/polyfills.bundle.js net::ERR_NAME_NOT_RESOLVED
    index:13 GET http://a2-struts/js/styles.bundle.js net::ERR_NAME_NOT_RESOLVED
    index:13 GET http://a2-struts/js/vendor.bundle.js net::ERR_NAME_NOT_RESOLVED
    index:13 GET http://a2-struts/js/main.bundle.js net::ERR_NAME_NOT_RESOLVED
    a2-struts/favicon.ico:1 GET http://a2-struts/favicon.ico net::ERR_NAME_NOT_RESOLVED

    The second suggestion from Felipe does work adding a script and launching it from npm does the trick.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Console+ / GitBash bug (ng build –base-href=/some-context-root/)

You must be logged in to post in the forum log in