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

Invalid project build when project path includes symlink #3797

Closed
drakulis opened this issue Dec 30, 2016 · 7 comments
Closed

Invalid project build when project path includes symlink #3797

drakulis opened this issue Dec 30, 2016 · 7 comments
Assignees
Labels
effort2: medium (days) P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity2: inconvenient type: bug/fix

Comments

@drakulis
Copy link

drakulis commented Dec 30, 2016

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.
@drakulis drakulis changed the title Invalid project build when project folder is a symlink. Invalid project build when project path includes symlink Dec 31, 2016
@memboc
Copy link

memboc commented Jan 12, 2017

same problem without symlink

@filipesilva
Copy link
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.

@filipesilva filipesilva added command: build P5 The team acknowledges the request but does not plan to address it, it remains open for discussion type: bug/fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed P5 The team acknowledges the request but does not plan to address it, it remains open for discussion labels Jan 24, 2017
@filipesilva filipesilva self-assigned this May 5, 2017
@filipesilva
Copy link
Contributor

Dupe of #2726, addressed by #6403.

@Wim-van-der-Veen
Copy link

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 :( )

@filipesilva
Copy link
Contributor

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

@minuz
Copy link

minuz commented Aug 28, 2017

@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?

@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
effort2: medium (days) P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity2: inconvenient type: bug/fix
Projects
None yet
Development

No branches or pull requests

5 participants