Skip to content

compiler fails on simplest of generated apps (with windows 10 junctions) #8603

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
bealtine opened this issue Nov 22, 2017 · 8 comments
Closed
Labels
help wanted P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix

Comments

@bealtine
Copy link

Versions

Angular CLI: 1.5.3
Node: 6.11.3
OS: win32 x64
Angular: 5.0.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.5.3
@angular-devkit/build-optimizer: 0.0.33
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.36
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.3
@schematics/angular: 0.1.5
typescript: 2.6.1
webpack: 3.8.1

Repro steps

using the most basic ng cli, using a "local dir" for "common files"works perfectly, however if I switch to a windows junction (with the same name and exactly the same files) compilation fails with:

Observed behavior

D:\web\angular4\teststuff\test-cli>ng build
Date: 2017-11-22T19:06:43.880Z
Hash: 68750acea9ebd39ab42b
Time: 4174ms
chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 5.83 kB [entry] [rendered]
chunk {main} main.bundle.js, main.bundle.js.map (main) 8.51 kB [initial] [rendered]
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 200 kB [initial] [rendered]
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 11.3 kB [initial] [rendered]
chunk {vendor} vendor.bundle.js, vendor.bundle.js.map (vendor) 1.92 MB [initial] [rendered]

ERROR in D:/web/tslibs5/tlibs.module.ts
Module build failed: Error: D:\web\tslibs5\tlibs.module.ts is not part of the compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
    at AngularCompilerPlugin.getCompiledFile (D:\web\angular4\teststuff\test-cli\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:619:23)
    at plugin.done.then (D:\web\angular4\teststuff\test-cli\node_modules\@ngtools\webpack\src\loader.js:467:39)
 @ ./src/app/app.module.ts 10:0-50
 @ ./src/main.ts
 @ multi ./src/main.ts

Desired behavior

What did you expect to see?

compiler to finish compilation...

test-cli.zip

Always happy to provide as much information as required...

@bealtine bealtine changed the title compiler fails on simplest of generated apps (with junctions) compiler fails on simplest of generated apps (with windows junctions) Nov 22, 2017
@bealtine bealtine changed the title compiler fails on simplest of generated apps (with windows junctions) compiler fails on simplest of generated apps (with windows 10 junctions) Nov 22, 2017
@filipesilva filipesilva self-assigned this Nov 23, 2017
@filipesilva filipesilva added package4: @angular-sdk/webpack P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix labels Nov 23, 2017
@zohar1000
Copy link

glad I've found this thread, I have the same error message and I would never thought it's the windows junction issue. for me as well - if I copy the junction folder to a local folder and work with it then the above error is gone. I'm on windows 7.

On previous projects that I worked with junction folders this problem didn't happen. I used to work with angular 4 without angular cli. I now started a new angular 5 project with angular cli by issuing 'new new ..' and added the source files from the angular 4 project just to end up with this error message. so I'm not sure which fault it is, angular 5 or angular cli.

It still looks strange that the windows junction is causing this kind of a problem, as far as I understand the os handles it and this junction folder should be seen as a local folder to the referring code.

I'm waiting for a solution on this one, the junction folder has a major importance since the code within it is shared among several projects, and now that it is not synced with the other code can lead to consistency bugs. please let us know once you can find something on this one. thanks.

@zohar1000
Copy link

a correction on the previous note, I use hard link and not a soft link, which is actually a junction.

@filipesilva
Copy link
Contributor

This issue is very similar to #5167 but then it only happened to CSS files. Here it is also happening with TS files.

@filipesilva filipesilva added help wanted P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful and removed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Dec 7, 2017
@zohar1000
Copy link

I've found this thread, they show how to use the --preserve-symlinks parameter, it worked for me, for example:
ng serve --host 0.0.0.0 --disable-host-check --preserve-symlinks --base-href /

however, it would be better to have this parameter in angular-cli.json, it's there for ng build, but not for serve or test.

@bealtine
Copy link
Author

bealtine commented Dec 14, 2017

This setup worked fine before the upgrade to the 1.6 branch though, I had used symlinks (junctions) in lots of projects. In the interim I've reverted to the 1.5 branch...

I used ng build --watch

@bealtine
Copy link
Author

bealtine commented Mar 8, 2018

for anyone stumbling onto this thread in the future...

One possible solution is to add the following build entry to your .angular-cli.json defaults section

"defaults": {
"build": {
"preserveSymlinks": true
},
"styleExt": "css",
"component": {}
}

As outlined here:
https://stackoverflow.com/questions/48797135/missing-ts-files-due-to-npm-link/48798373#48798373

@mgechev
Copy link
Member

mgechev commented Jan 22, 2019

@bealtine thanks for sharing this!

@mgechev mgechev closed this as completed Jan 22, 2019
@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 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix
Projects
None yet
Development

No branches or pull requests

5 participants