angular-cli: Could not resolve route

angular-cli: 1.0.0-beta.22-1 node: 7.1.0 os: linux x64

i’m new to angular2 and not sure how loadChildren is supposed to work. I upgraded coreui from angular 2.1.2 to 2.2.3 and it broke here:

Could not resolve route "app/dashboard/dashboard.module#DashboardModule" from file 
"/home/aep/kram/CoreUI-Free-Bootstrap-Admin-
Template/Angular2_CLI_Full_Project/src/app/app.module".
        children: [
            {
                path: 'dashboard',
                loadChildren: 'app/dashboard/dashboard.module#DashboardModule'
            },

what’s the path supposed to be with this relative structure?

src/app/app.module.ts
src/app/dashboard/dashboard.module.ts

i tried:

  • app/dashboard/dashboard.module#DashboardModule
  • dashboard/dashboard.module#DashboardModule
  • …/app/dashboard/dashboard.module#DashboardModule
  • …/…/dashboard/dashboard.module#DashboardModule
  • src/app/dashboard/dashboard.module#DashboardModule

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 4
  • Comments: 16

Most upvoted comments

I think somehow angular has changed their path resolver. By changing the path from

app/dir1/dir2/...

(assuming the routes module is configured inside app directory) to ./dir1/dir2/...

Can solve this problem.