question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ng serve watch capability and ng build --aot capability for symbolically linked modules on Windows machines.

See original GitHub issue

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.2.0 node: 8.1.2 os: win32 x64

Repro steps.

  1. Clone https://github.com/johnpapa/angular-tour-of-heroes.git
  2. Separate Heroes module into modules folder
+---.vscode
+---e2e
+---modules
|   \---heroes
\---src
    +---app
    +---assets
    \---environments
  1. Create heroes package.json in modules/heroes
npm init heroes
  1. Create a symbolic link/junction from node_modules/heroes to modules/heroes folder
mklink /J "node_modules/heroes" "modules/heroes"
  1. Add reference to project’s main package.json
 "dependencies": {
    ...
    "heroes": "*"
  },

5.1 Run ng serve 5.2 Run ng build --aot

The log given by the failure.

5.1. Run ng serve

Failed to compile.

./modules/heroes/heroes.component.ts
Module build failed: Error
    at WebpackCompilerHost.populateWebpackResolver (G:\GIT\Angular\angular-tour-of-heroes\node_modules\@ngtools\webpack\src\compiler_host.js:135:51)
    at _donePromise.Promise.resolve.then.then.then.then.then (G:\GIT\Angular\angular-tour-of-heroes\node_modules\@ngtools\webpack\src\plugin.js:371:32)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:169:7)
 @ ./modules/heroes/heroes.module.ts 11:0-53
 @ ./src async
 @ ./~/@angular/core/@angular/core.es5.js
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts

5.2. Run ng build --aot

ERROR in Cannot determine the module for class HeroDetailComponent in G:/GIT/Angular/angular-tour-of-heroes/src/app/components/her
o-detail/hero-detail.component.ts! Add HeroDetailComponent to the NgModule to fix it.

ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'G:\GIT\Angular\angular-tour-of-heroes\src'
 @ ./src/main.ts 3:0-74
 @ multi ./src/main.ts

Desired functionality.

ng serve watch and ng build --aot capability for symbolically linked modules on Windows machines. This does not seem to be an issue on Linux machines.

Mention any other details that might be useful.

The same issues also occurs with modules linked by lerna. For example: https://github.com/OasisDigital/scalable-enterprise-angular.git

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
filipesilvacommented, Aug 2, 2017

I believe the --preserve-symlinks already solves this (https://github.com/angular/angular-cli/pull/6460).

1reaction
filipesilvacommented, Aug 10, 2017

That particular side effect intended per se… but it is by design, in a way. You can find more information about the problems in that sort of setup in https://github.com/angular/angular-cli/issues/6387#issuecomment-302749300 and https://github.com/angular/angular-cli/issues/6228#issuecomment-301024884.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ng-serve Typescrypt compiling issue with symbolic linked ...
It seems like there is nothing wrong with the compilation, because if I do a tsc build the output is fine. What I...
Read more >
Kickoff Angular Full-Stack Development and Stop Using “ng ...
Stop using ng serve to run the app. Integrate frontend and backend with ng build --watch --output-path , that makes the compiled Angular ......
Read more >
ng build ignore warnings | The AI Search Engine You Control
When you run ng build , you are using globally installed angular-cli, since it is different than locally installed one, it may cause...
Read more >
Angular Interview Questions // Unstop (formerly Dare2Compete)
To build the directive class file, run the CLI command ng generate directive. It creates a source file (src/app/components/directivename.
Read more >
Untitled
Miax fee schedule, Qwebpage linkclicked, Cruzan amphitheater capacity, Samiye yildirim pwc, ... Windows 2003 iis service unavailable, Zene bikovi u ljubavi, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found