Skip to content

Invalid project build when project path includes symlink #3797

Closed

Description

@drakulis

OS?

Windows 7

Versions.

angular-cli: 1.0.0-beta.24
node: 6.5.0
os: win32 ia32
@angular/common: 2.4.1
@angular/compiler: 2.4.1
@angular/core: 2.4.1
@angular/forms: 2.4.1
@angular/http: 2.4.1
@angular/platform-browser: 2.4.1
@angular/platform-browser-dynamic: 2.4.1
@angular/router: 3.4.1
@angular/compiler-cli: 2.4.1

npm: 3.10.3

Repro steps.

  • create symbolic link to folder using mklink command, eg.
    mklink D:\workspace-link R:\workspace /J
    where
    R:\workspace is a phisical folder
    D:\workspace-link is a symbolic link which pointing to R:\workspace
    /J is a switch indicating that it has to be folder link
  • navigate to R:\workspace
  • execute ng new test-project
  • cd test-project
  • set some global styles (eg. body { background-color: #99ff99; } ) in src/styles.css
  • ng serve

project run perfectly fine, global styles are applied in application. Now run the project through symlink folder:

  • navigate to D:\workspace-link\test-project
  • ng serve

project seems to be build successfully and even runs in the browser but in some different way, eg no vendor.bundle.js is emitted, no styles.bundle.css etc. But the more important thing is that global styles have not been applied in the application!

Output:

Image of Yaktocat

R:\workspace\GIT\iot-config>ng serve
** NG Live Development Server is running on http://localhost:4200. **
Hash: e998220d54d5437f33c0
Time: 10934ms
chunk    {0} main.bundle.js, main.bundle.map (main) 4.59 kB {2} [initial] [rendered]
chunk    {1} styles.bundle.css, styles.bundle.map, styles.bundle.map (styles) 1.73 kB {3} [initial] [rendered]
chunk    {2} vendor.bundle.js, vendor.bundle.map (vendor) 2.83 MB [initial] [rendered]
chunk    {3} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]
webpack: bundle is now VALID.

R:\workspace\GIT\iot-config>D:

D:\workspace\GIT\iot-config>ng serve
** NG Live Development Server is running on http://localhost:4200. **
Hash: 7bf8c693f9546528f93a
Time: 25323ms
chunk    {0} styles.bundle.map (styles) 87 bytes {2} [initial] [rendered]
chunk    {1} main.bundle.js, main.bundle.map (main) 2.82 MB [initial] [rendered]
chunk    {2} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]
webpack: bundle is now VALID.

Activity

  1. changed the title [-]Invalid project build when project folder is a symlink.[/-] [+]Invalid project build when project path includes symlink[/+] on Dec 31, 2016
  2. memboc commented on Jan 12, 2017

    @memboc

    same problem without symlink

  3. filipesilva commented on Jan 24, 2017

    @filipesilva
    Contributor

    I can verify this happens. It's due to the way we resolve the node_modules path, which is used for detection of what should go into the vendor bundle.

  4. added
    P5
    P3
    and removed
    P5
    on Jan 24, 2017
  5. self-assigned this
    on May 5, 2017
  6. filipesilva commented on May 22, 2017

    @filipesilva
    Contributor

    Dupe of #2726, addressed by #6403.

  7. Wim-van-der-Veen commented on Jul 7, 2017

    @Wim-van-der-Veen

    In addition to this, if i have a running and producable project with root-folder f.i. D:\bla\bla\bla\project, then create a soft symlink to this f.i. D:\prj, and try to run 'ng serve' from there, i get all sorts of trouble
    Also, if i share the project folder, then create (on the same machine) a network-connection to it thus having a drive f.i. Q: which is the root of my valid project (containing node-modules, src, etc) 'ng serve' says 'you have to be inside an angular-cli project ... etc'. Well, i am, am i?
    (both Win10, btw; i tried this because my project is rather deep in the directory tree and i wanted to shorten all ng-produced messages in order to keep it readable :( )

  8. filipesilva commented on Jul 17, 2017

    @filipesilva
    Contributor

    @Wim-van-der-Veen this should be fixed in the new versions, are you sure you've updated?

  9. minuz commented on Aug 28, 2017

    @minuz

    @filipesilva I just update my project to angular-cli 1.3.2 and I'm getting the same issue. Are you sure this has been fixed? :)

    To move past this issue I had to write a little gulp task to copy my standalone library to node_modules of the demo for the time being. Any other solutions?

  10. angular-automatic-lock-bot commented on Sep 7, 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.

  11. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3effort2: medium (days)severity2: inconvenienttype: bug/fix

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions