Angular 4webpack: Failed to compile. when start the app (i.e running ng serve)

1,136 views
Skip to first unread message

babu.bal...@digiapt.com

unread,
Oct 7, 2017, 12:23:21 AM10/7/17
to Angular and AngularJS discussion
getting the error of

ERROR in TypeError: Cannot read property 'getSymbolByModule' of undefined
    at StaticReflector.findDeclaration (....node_modules/@angular/compiler/bundles/compiler.umd.js:24517:62)
    at StaticReflector.initializeConversionMap (...node_modules/@angular/compiler/bundles/compiler.umd.js:24735:36)
    at new StaticReflector (.....node_modules/@angular/compiler/bundles/compiler.umd.js:24477:14)
    at Function.NgTools_InternalApi_NG_2.listLazyRoutes (......./node_modules/@angular/compiler-cli/src/ngtools_api.js:77:31)
    at AotPlugin._getLazyRoutesFromNgtools (......./node_modules/@ngtools/webpack/src/plugin.js:207:44)
    at _donePromise.Promise.resolve.then.then.then.then.then (..../node_modules/@ngtools/webpack/src/plugin.js:443:24)
    at process._tickCallback (internal/process/next_tick.js:103:7)

webpack: Failed to compile.

Following is the part of the content of package.json

  "dependencies": {
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "@ngui/datetime-picker": "^0.16.2",
    "@types/underscore": "^1.8.1",
    "angular2-cookie": "^1.2.6",
    "bootstrap": "^3.3.7",
    "core-js": "^2.4.1",
    "jquery": "^3.2.1",
    "ng2-bootstrap-modal": "^1.0.1",
    "ng2-bs3-modal": "^0.13.0",
    "ng2-charts": "^1.6.0",
    "ng2-cookies": "^1.0.12",
    "ng2-file-upload": "^1.2.1",
    "ng2-opd-popup": "^1.1.21",
    "ng2-pagination": "^2.0.1",
    "ngx-bootstrap": "^1.7.1",
    "ngx-cookie": "^1.0.0",
    "rxjs": "^5.2.0",
    "ts-helpers": "^1.1.1",
    "underscore": "^1.8.3",
    "zone.js": "^0.8.5"
  },
  "devDependencies": {
    "@angular/cli": "^1.4.5",
    "@angular/compiler-cli": "^2.3.1",
    "@types/jasmine": "2.5.38",
    "@types/node": "^6.0.60",
    "codelyzer": "~2.0.0-beta.1",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "2.5.0",
    "karma": "1.2.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-remap-istanbul": "^0.2.1",
    "protractor": "~4.0.13",
    "ts-node": "1.2.1",
    "tslint": "^4.3.0",
    "typescript": "~2.2.2"
  }
}

Sander Elias

unread,
Oct 7, 2017, 1:09:00 AM10/7/17
to Angular and AngularJS discussion

What did you try?

I would upgrade all dependencies to their latest versions. remove node_modules and npm install again.

Regards
Sander

babu.bal...@digiapt.com

unread,
Oct 7, 2017, 4:54:55 AM10/7/17
to Angular and AngularJS discussion
Hi Sander,

Worked.

Thanks .

I have changed updated angular version to 4.4.4

It worked

following is my package.json

"dependencies": {
    "@angular/common": "^4.4.4",
    "@angular/compiler": "^4.4.4",
    "@angular/core": "^4.4.4",
    "@angular/forms": "^4.4.4",
    "@angular/http": "^4.4.4",
    "@angular/platform-browser": "^4.4.4",
    "@angular/platform-browser-dynamic": "^4.4.4",
    "@angular/router": "^4.4.4",

    "@ngui/datetime-picker": "^0.16.2",
    "@types/underscore": "^1.8.1",
    "angular2-cookie": "^1.2.6",
    "bootstrap": "^3.3.7",
    "core-js": "^2.4.1",
    "jquery": "^3.2.1",
    "ng2-bootstrap-modal": "^1.0.1",
    "ng2-bs3-modal": "^0.13.0",
    "ng2-charts": "^1.6.0",
    "ng2-cookies": "^1.0.12",
    "ng2-file-upload": "^1.2.1",
    "ng2-opd-popup": "^1.1.21",
    "ng2-pagination": "^2.0.1",
    "ngx-bootstrap": "^1.7.1",
    "ngx-cookie": "^1.0.0",
    "rxjs": "^5.2.0",
    "ts-helpers": "^1.1.1",
    "underscore": "^1.8.3",
    "zone.js": "^0.8.5"
  },
  "devDependencies": {
    "@angular/cli": "^1.4.5",
    "@angular/compiler-cli": "^4.4.4",

    "@types/jasmine": "2.5.38",
    "@types/node": "^6.0.60",
    "codelyzer": "~2.0.0-beta.1",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "2.5.0",
    "karma": "1.2.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-cli": "^1.0.1",
    "karma-jasmine": "^1.0.2",
    "karma-remap-istanbul": "^0.2.1",
    "protractor": "~4.0.13",
    "ts-node": "1.2.1",
    "tslint": "^4.3.0",
    "typescript": "~2.2.2"
  }
}

Reply all
Reply to author
Forward
0 new messages