"WARNING in Duplicated path in loadChildren detected during rebuild." Duplicate paths

0

What can be wrong to cause in warn ? 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.

    
asked by anonymous 21.06.2018 / 15:05

1 answer

1

There are a couple of reasons I found for warn to occur. It was reported in issue 8722 of angular-cli but I found one besides these answers that fit.

  • lazyModules at angular.json
    this was the reason I stayed a few days trying to adjust this warn . With Angular 6 there is a new property called lazyModules in "architect":{ "build":{ "options"{ "lazyModules":[] } } } In this property you should be informed of the modules that are not mapped in routes and that you would like them to be loaded lazily. If you report a module on this property and the same module on the routes, warn will occur. Clearing this property has stopped warn from occurring to me.
  • duplicate routes
    within this angular-cli issue it was pointed out that the module path may be doubling the cli route from the angular, so it is necessary to inform the path correctly in the route so that cli understands the root route and does not duplicate with the daughter routes . This warn was adjusted by the others with the loadChildren property adjustment as follows:
    Before (with error): { path: 'orders', loadChildren: './orders/orders.module#OrdersModule'}
    Now:
    { path: 'orders', loadChildren: 'app/orders/orders.module#OrdersModule'}
  • Last route with a comma at the end
    yes, you did not read wrong kk, by the tests I did here it did not occur to me using angle 6, but some users%% verified in issue # 8722 just by adding a comma at the end of the last route declared. warn

I also found on other sites that if I am given a link in the tsconfig.json file in the { path: 'threed', loadChildren: './threed/threed.module#ThreedModule'}, property, I could report a "paths" equal to other routes, but I can not reproduce loadChildren doing so too. >
With this question / answer I hope that other users will be able to resolve this warn more easily. Hugs

    
21.06.2018 / 15:05