Skip to content

loadChildren on modules that are outside src fails #6755

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
cedvdb opened this issue Jun 20, 2017 · 2 comments
Closed

loadChildren on modules that are outside src fails #6755

cedvdb opened this issue Jun 20, 2017 · 2 comments

Comments

@cedvdb
Copy link

cedvdb commented Jun 20, 2017

Bug Report or Feature Request (mark with an x)

- [ X ] bug report 

Explanation

I've seen multiple people on gitter and on stackoverflow being confused by this, including me. When the router uses lazy loading with a module that is outside the src folder (in node_modules for instance) the build will fail giving the error: ERROR in ./src/$$_gendir async

Related to this and this

If you can provide a simple repro we can investigate.

Repro steps.

git clone https://github.com/cedvdb/test-aot-bug.git && cd test-aot-bug && npm install && ng serve --aot

The error will appear in the console at the end. I cannot make a plnkr for this.

The log given by the failure.

ERROR in ./src/$$_gendir async
Module not found: Error: Can't resolve '/home/ced/Documents/angular/aot-bug/s
rc/node_modules/test-aot-bug/test.module.ngfactory.ts' in '/home/ced/Documents/angular/aot-bug/src/$$_gendir'
 @ ./src/$$_gendir async
 @ ./~/@angular/core/@angular/core.es5.js
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts

notice it tries to find node_modules in the src folder.

Desired functionality.

It would be nice if loadChildren worked with ngModules that are outside the src folder. Mainly the node_modules folder

Versions.

@angular/cli: 1.1.2
node: 8.0.0
os: linux x64

@filipesilva
Copy link
Contributor

Heya, we're tracking this in #6373. I appreciate the simple repro, and will link it there.

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

No branches or pull requests

2 participants