2017-12-19 12 views
0

오늘 Angular 4.4.4에서 5.1.1로 업그레이드하기 시작했습니다. 나는 각도에 의존하는 많은 다른 패키지를 업그레이드해야했다. 나는 어디서부터 시작 해야할지 전혀 모른다는 약간의 상황으로 인해 오류가 발생합니다. 다른 사람이 이것을보고 문제가 무엇인지 알고 있습니까?TypeError : 정의되지 않은 'members'속성을 읽을 수 없습니다.

$ ng serve --aot=false 
** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ ** 
Date: 2017-12-19T15:26:36.137Z 
Hash: bf0b773d5dfafdd9133b 
Time: 16934ms 
chunk {inline} inline.bundle.js (inline) 5.79 kB [entry] [rendered] 
chunk {main} main.bundle.js (main) 2.93 kB [initial] [rendered] 
chunk {polyfills} polyfills.bundle.js (polyfills) 636 bytes [initial] [rendered] 
chunk {scripts} scripts.bundle.js (scripts) 307 kB [initial] [rendered] 
chunk {styles} styles.bundle.js (styles) 4.03 MB [initial] [rendered] 
chunk {vendor} vendor.bundle.js (vendor) 855 kB [initial] [rendered] 

ERROR in TypeError: Cannot read property 'members' of undefined 
    at AotSummaryResolver.resolveSummary (C:\source\app\node_modules\@angular\compiler\bundles\compiler.umd.js:32638:56) 
    at CompileMetadataResolver._loadSummary (C:\source\app\node_modules\@angular\compiler\bundles\compiler.umd.js:14825:66) 
    at CompileMetadataResolver._getEntryComponentMetadata (C:\source\app\node_modules\@angular\compiler\bundles\compiler.umd.js:15857:66) 
    at C:\source\app\node_modules\@angular\compiler\bundles\compiler.umd.js:15323:55 
    at Array.map (<anonymous>) 
    at CompileMetadataResolver.getNgModuleMetadata (C:\source\app\node_modules\@angular\compiler\bundles\compiler.umd.js:15323:18) 
    at CompileMetadataResolver.getNgModuleSummary (C:\source\app\node_modules\@angular\compiler\bundles\compiler.umd.js:15157:52) 
    at C:\source\app\node_modules\@angular\compiler\bundles\compiler.umd.js:15245:72 
    at Array.forEach (<anonymous>) 
    at CompileMetadataResolver.getNgModuleMetadata (C:\source\app\node_modules\@angular\compiler\bundles\compiler.umd.js:15230:49) 
    at visitLazyRoute (C:\source\app\node_modules\@angular\compiler\bundles\compiler.umd.js:31061:104) 
    at AotCompiler.listLazyRoutes (C:\source\app\node_modules\@angular\compiler\bundles\compiler.umd.js:31029:20) 
    at AngularCompilerProgram.listLazyRoutes (C:\source\app\node_modules\@angular\compiler-cli\src\transformers\program.js:156:30) 
    at Function.NgTools_InternalApi_NG_2.listLazyRoutes (C:\source\app\node_modules\@angular\compiler-cli\src\ngtools_api.js:44:36) 
    at AngularCompilerPlugin._getLazyRoutesFromNgtools (C:\source\app\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:248:66) 
    at Promise.resolve.then.then (C:\source\app\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:562:50) 

webpack: Failed to compile. 

나는 이상한 그것은 내가 봉사 명령 = false를 --aot 때 AotSummaryResolver에서 시작 것을 찾을 수 있습니다.

{ 
    "name": "test", 
    "version": "0.0.0", 
    "license": "MIT", 
    "scripts": { 
    "ng": "ng", 
    "start": "ng serve --aot=false", 
    "build": "ng build", 
    "test": "ng test", 
    "lint": "ng lint", 
    "e2e": "ng e2e" 
    }, 
    "private": true, 
    "dependencies": { 
    "@agm/core": "^1.0.0-beta.2", 
    "@angular-devkit/schematics": "^0.0.42", 
    "@angular/animations": "5.1.1", 
    "@angular/cdk": "5.0.1", 
    "@angular/common": "5.1.1", 
    "@angular/compiler": "5.1.1", 
    "@angular/core": "5.1.1", 
    "@angular/forms": "5.1.1", 
    "@angular/http": "5.1.1", 
    "@angular/platform-browser": "5.1.1", 
    "@angular/platform-browser-dynamic": "5.1.1", 
    "@angular/platform-server": "5.1.1", 
    "@angular/router": "5.1.1", 
    "@auth0/angular-jwt": "^1.0.0-beta.9", 
    "@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.8", 
    "@ng-idle/core": "^2.0.0-beta.13", 
    "@ngrx/core": "^1.2.0", 
    "@ngrx/effects": "^4.1.1", 
    "@ngrx/entity": "^4.1.1", 
    "@ngrx/store": "^4.1.1", 
    "@ngrx/store-devtools": "^4.1.1", 
    "@schematics/angular": "^0.1.11", 
    "@schematics/schematics": "^0.0.11", 
    "angular2-counto": "^1.2.3", 
    "bootstrap": "4.0.0-beta.2", 
    "core-js": "2.4.1", 
    "d3": "^4.11.0", 
    "echarts": "^3.6.0", 
    "echarts-gl": "^1.0.0-alpha.5", 
    "font-awesome": "^4.7.0", 
    "global": "^4.3.2", 
    "intl": "^1.2.5", 
    "jquery": "^3.2.1", 
    "moment": "^2.19.4", 
    "ng2-dnd": "^5.0.2", 
    "popper.js": "^1.11.0", 
    "roboto-fontface": "^0.7.0", 
    "rxjs": "^5.5.2", 
    "toastr": "^2.1.2", 
    "ts-action": "^3.2.2", 
    "typings": "^2.1.1", 
    "uuid": "^3.1.0", 
    "web-animations-js": "^2.2.5", 
    "yarn": "^0.24.5", 
    "zone.js": "0.8.4" 
    }, 
    "devDependencies": { 
    "@angular/cli": "1.6.1", 
    "@angular/compiler-cli": "5.1.1", 
    "@types/d3": "^4.11.0", 
    "@types/echarts": "^0.0.6", 
    "@types/hammerjs": "^2.0.34", 
    "@types/jasmine": "2.5.38", 
    "@types/jquery": "^2.0.45", 
    "@types/node": "^7.0.23", 
    "@types/toastr": "^2.1.33", 
    "@types/uuid": "^3.4.0", 
    "codelyzer": "^4.0.2", 
    "jasmine-core": "~2.5.2", 
    "jasmine-spec-reporter": "~3.2.0", 
    "json-server": "^0.12.0", 
    "jsonwebtoken": "^7.4.1", 
    "karma": "~1.4.1", 
    "karma-chrome-launcher": "~2.1.1", 
    "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": "^5.8.0", 
    "typemoq": "^1.7.0", 
    "typescript": "2.4.2" 
    } 
} 

내 각-CLI 버전은 1.6.1입니다 :

여기 내 package.json입니다.

오류는 각 소스 코드를 여기에서 발생하는 것 같습니다 :

은 이전에 내가이 정확 - 부트 스트랩을 겨 관련이 있다고 생각 https://github.com/angular/angular/blob/b3eb1db6dd57a0820cfc94af5460ceb3fea20610/packages/compiler/src/aot/summary_resolver.ts#L68

편집. 다음과 같이

나는 compiler.umd.js에 라인 15207에서 콘솔 로그를 저장하여 몇 가지 상황을 발견 : 내가 가진 모듈을했다

... 
entryComponents: [ undefined ], 
... 

: 결과

if (meta.entryComponents) { 
    console.log(meta); 
    entryComponents.push.apply(entryComponents, flattenAndDedupeArray(meta.entryComponents) 
       .map(function (type) { return /** @type {?} */ ((_this._getEntryComponentMetadata(type))); })); 
} 

entryComponents: [MdProgressSpinner]MdProgressSpinner을 가져 오지 않았습니다. 내가 그것을 제거했을 때 오류가 사라 졌어요 ... 그리고 다음 하나가 왔어요 :)

+0

당신은 확실이 업그레이드 전에 일을하기 위해 전에 코드를 테스트 했습니까? –

+0

제 3 자 각 관련 패키지가 많습니다. 이것은 버전 변경 (변경 사항 변경)이므로 모든 패키지가 새 버전을 지원하는지 확인해야합니다. (ng-boostrap, ng-idle, ngrx, schematic, angular2-counto 등) –

+0

@MikeTung 예, 업그레이드 직전에 실행했습니다. – bygrace

답변

0

이것은 당신이 app 모듈에서 일어날 수있는 이유 중 하나입니다. 빌드 프로세스가 가져 오기를 찾을 수없는 항목 구성 요소가 있습니다. for (아래 예제에서 import 라인을 주석 처리하고 컴포넌트를 남겨두면이 에러가 발생합니다). enter image description here

enter image description here