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

Build fails when using symbolic link folder in Windows #9807

Closed
briannoyes opened this issue Feb 28, 2018 · 4 comments
Closed

Build fails when using symbolic link folder in Windows #9807

briannoyes opened this issue Feb 28, 2018 · 4 comments

Comments

@briannoyes
Copy link

Versions

Angular CLI: 1.7.1
Node: 8.9.4
OS: win32 x64
Angular: 5.2.6
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.7.1
@angular-devkit/build-optimizer: 0.3.2
@angular-devkit/core: 0.3.2
@angular-devkit/schematics: 0.3.2
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.1
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.5.3
webpack: 3.11.0

Repro steps

Create symbolic link to folder where you will work:
mklink /d C:\myshortpath C:\some\really\deep\folder\Idontwant\to\type
cd C:\myshortpath
C:\myshortpath> ng new mycoolapp
C:\myshortpath> ng serve

Observed behavior

ERROR in c:/some/really/deep/folder/Idontwant/to/type/mycoolapp/src/main.ts
Module build failed: Error: c:\some\really\deep\folder\Idontwant\to\type\mycoolapp\src\main.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (c:\some\really\deep\folder\Idontwant\to\type\mycoolapp\node_modules@ngtools\webpack\src\angular_compiler_plugin.js:674:23)
at plugin.done.then (c:\some\really\deep\folder\Idontwant\to\type\mycoolapp\node_modules@ngtools\webpack\src\loader.js:467:39)
at
ERROR in c:/some/really/deep/folder/Idontwant/to/type/mycoolapp/src/polyfills.ts
Module build failed: Error: c:\some\really\deep\folder\Idontwant\to\type\mycoolapp\src\polyfills.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at AngularCompilerPlugin.getCompiledFile (c:\some\really\deep\folder\Idontwant\to\type\mycoolapp\node_modules@ngtools\webpack\src\angular_compiler_plugin.js:674:23)
at plugin.done.then (c:\some\really\deep\folder\Idontwant\to\type\mycoolapp\node_modules@ngtools\webpack\src\loader.js:467:39)
at

webpack: Failed to compile.

Desired behavior

No error

Mention any other details that might be useful (optional)

Kind of an edge case, not sure it is really a priority to fix, but wanted it at least documented for the next poor soul who gets stuck on it.

@bealtine
Copy link

For people stumbling onto this
Try adding this to your angular-cli.json file

"build": {
  "preserveSymlinks": true 
},

like this:

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

This worked for me on my test apps...and hopefully for you too

@thrixton
Copy link

This has been moved under build >> options as of angular 5?/6+

"build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "preserveSymlinks": true,

@ngbot ngbot bot added this to the needsTriage milestone Jan 24, 2019
@filipesilva
Copy link
Contributor

Closing as fixed per the comment above.

@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.
Projects
None yet
Development

No branches or pull requests

5 participants