angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.76k stars 11.98k forks source link

ERROR in Could not resolve "app/requests/requests.module" #8181

Closed rkumar654 closed 6 years ago

rkumar654 commented 6 years ago

{path:'requests',loadChildren:'src/app/requests/requests.module#RequestsModule'}

i am using angular/cli 2.4.0 version

i getting error like this..

ERROR in Could not resolve "app/request/request.module" from "D:/internet-bankin g/src/app/app-routing.module.ts".

my package.json file

{ "name": "internet-banking", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/common": "^2.4.0", "@angular/compiler": "^2.4.0", "@angular/core": "^2.4.0", "@angular/forms": "^2.4.0", "@angular/http": "^2.4.0", "@angular/platform-browser": "^2.4.0", "@angular/platform-browser-dynamic": "^2.4.0", "@angular/router": "^3.4.0", "@ngx-translate/core": "^7.0.0", "@ngx-translate/http-loader": "^0.1.0", "@types/highcharts": "^4.2.57", "angular2-fullcalendar": "^1.0.19", "angular2-modal": "^3.0.1", "angular2-text-equality-validator": "^2.0.0", "angular2-useful-swiper": "^5.0.0", "bootstrap": "^3.3.7", "chart.js": "^2.6.0", "core-js": "^2.4.1", "highcharts": "0.0.11", "jquery": "^3.2.1", "ng2-bootstrap": "^1.6.3", "ng2-charts": "^1.6.0", "ng2-daterangepicker": "^2.0.8", "ng2-highcharts": "^0.6.5", "ng2-translate": "^5.0.0", "ngx-bootstrap": "^1.7.1", "rxjs": "^5.1.0", "swiper": "^4.0.0-beta.2", "zone.js": "^0.7.6" }, "devDependencies": { "@angular/cli": "1.0.0-rc.2", "@angular/compiler-cli": "^2.4.0", "@types/jasmine": "2.5.38", "@types/jquery": "^2.0.47", "@types/node": "~6.0.60", "codelyzer": "~2.0.0", "jasmine-core": "~2.5.2", "jasmine-spec-reporter": "~3.2.0", "karma": "~1.4.1", "karma-chrome-launcher": "~2.0.0", "karma-cli": "~1.0.1", "karma-coverage-istanbul-reporter": "^0.2.0", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.1.0", "ts-node": "~2.0.0", "tslint": "~4.5.0", "typescript": "~2.0.0" } }

How to solve this?

filipesilva commented 6 years ago

Hi, in the loadChildren string please use a relative path from the file location instead of a path from the project root. In your case I think that will be {path:'requests',loadChildren:'./requests/requests.module#RequestsModule'} (notice the ./ at the start).

This sort of question is better suited for a support site like Stack Overflow though. The issue tracker for Angular CLI is more for bugs than support questions.

rkumar654 commented 6 years ago

i have to change my path like this.."requests/requests.module#RequestsModule " but its not working

Damini17 commented 5 years ago

@filipesilva Your solution worked for me. Thanks!

angular-automatic-lock-bot[bot] commented 5 years ago

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.