Skip to content

loadChildren on modules that are outside src fails #6755

Closed

Description

@cedvdb

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

Activity

  1. filipesilva commented on Jun 26, 2017

    @filipesilva
    Contributor

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

  2. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  3. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions