angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

WARNING in Duplicated path in loadChildren detected during a rebuild

Open arnaudoisel opened this issue 8 years ago • 27 comments

Versions

Angular CLI: 1.5.0
Node: 8.9.1
OS: win32 x64
Angular: 5.0.5
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.5.0
@angular-devkit/build-optimizer: 0.0.34
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.38
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.0
@schematics/angular: 0.1.8
typescript: 2.4.2
webpack: 3.8.1

Repro steps

  • Checkout the project : https://github.com/arnaudoisel/lazy-loading-routes-bug
  • > yarn (or npm install)
  • > ng serve
  • Modify the "routes.ts" file (by adding a comment for example)
  • Save the file => The warning will be displayed in the console

Observed behavior

With Angular CLI, if a project contains a module that is lazy loaded, when we modify the file containing the routes, after the automatic rebuild by Angular CLI, the following warning message is displayed in the console :

WARNING in Duplicated path in loadChildren detected during a rebuild. We will take the latest version detected and override it to save rebuild time. You should perform a full build to validate that your routes don't overlap.

Desired behavior

Desired : No warning message displayed in console.

Otherwise it might cause bugs while developping. And even without any real issue, the warning message is a bit scary and could prevent from acknowledging real bugs in the application.

arnaudoisel avatar Dec 02 '17 13:12 arnaudoisel

full path worked great!

edcline avatar Mar 02 '18 13:03 edcline

@frederikocmr thank you very much

lakerko avatar Mar 21 '18 18:03 lakerko

@frederikocmr Thanks very a lot .

dreamdevil00 avatar Mar 27 '18 03:03 dreamdevil00

thanks @frederikocmr!! 👍

raphaelfruneaux avatar Apr 04 '18 16:04 raphaelfruneaux

@frederikocmr it works thanks .

kingkassem avatar Apr 07 '18 17:04 kingkassem

changing from ./employees/employees.module to app/employees/employees.module results in browser console error Error: Cannot find module 'app/employees/employees.module'. ng build bundles fine though.

both the app-routing.module.ts and employees folder are immediate children of the app folder

eagor avatar May 21 '18 12:05 eagor

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.