2017-11-16 2 views
2

すべての依存関係を使用してSPAを角度4から角度5に更新しました。これまでのところうまく動作します。開発者とプロダクトは非常にうまく動作します。エラーや警告はありません。角5 uglifyingビルドエラーを返します

--prodフラグを使用してSPAを構築すると、angular-cliがビルドされます。 angular-cliからのエラーはありません。しかし、ブラウザでSPAを開くと、エラーが発生して何も起こりません。ページはまったく読み込まれません(読み込みスピナーのみ)。ここで

Uncaught Error: Unexpected value 'Ie' imported by the module 't'. Please add a @NgModule annotation. 
at c (compiler.js:466) 
at compiler.js:15088 
at Array.forEach (<anonymous>) 
at t.getNgModuleMetadata (compiler.js:15071) 
at t.getNgModuleSummary (compiler.js:14998) 
at compiler.js:15086 
at Array.forEach (<anonymous>) 
at t.getNgModuleMetadata (compiler.js:15071) 
at t._loadModules (compiler.js:33486) 
at t._compileModuleAndComponents (compiler.js:33447) 

は、すべての依存関係と私のビルドスクリプトと私のpackage.jsonです:ここ

{ 
    "name": "broadcast-manager", 
    "version": "0.1.0", 
    "license": "MIT", 
    "scripts": { 
     "ng": "ng", 
     "dev": "ng serve --dev --environment main --port 1337 --host 0.0.0.0 --proxy-config proxy.conf.json", 
     "prod": "ng build --prod --environment main --aot false" 
    }, 
    "private": true, 
    "dependencies": { 
     "@angular/animations": "^5.0.1", 
     "@angular/cli": "^1.5.0", 
     "@angular/common": "^5.0.1", 
     "@angular/compiler": "^5.0.1", 
     "@angular/compiler-cli": "^5.0.1", 
     "@angular/core": "^5.0.1", 
     "@angular/forms": "^5.0.1", 
     "@angular/http": "^5.0.1", 
     "@angular/platform-browser": "^5.0.1", 
     "@angular/platform-browser-dynamic": "^5.0.1", 
     "@angular/router": "^5.0.1", 
     "@swimlane/ngx-charts": "^6.1.0", 
     "@swimlane/ngx-datatable": "^11.0.4", 
     "@types/jwt-decode": "^2.2.1", 
     "@types/node": "^8.0.53", 
     "bootstrap": "4.0.0-alpha.6", 
     "codelyzer": "^4.0.1", 
     "core-js": "^2.5.1", 
     "d3": "^4.11.0", 
     "jwt-decode": "2.2.0", 
     "moment": "^2.19.2", 
     "ng2-dnd": "^4.2.0", 
     "ngx-bootstrap": "^2.0.0-beta.8", 
     "ngx-chips": "^1.5.9", 
     "node-sass": "^4.6.1", 
     "protractor": "^5.2.0", 
     "rxjs": "^5.5.2", 
     "ts-node": "^3.3.0", 
     "tslint": "^5.8.0", 
     "typescript": "^2.6.1", 
     "zone.js": "^0.8.18" 
    }, 
    "devDependencies": {} 
} 

そして、私の.angular-cli.json

{ 
    "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 
    "project": { 
    "name": "broadcast" 
    }, 
    "apps": [ 
    { 
     "root": "src", 
     "outDir": "../public/frontend", 
     "assets": [ 
     "assets", 
     ".htaccess", 
     "favicon.ico", 
     { 
    "glob": "**/*", 
    "input": "../node_modules/font-awesome/fonts/", 
    "output": "./assets/fonts/" 
} 
     ], 
     "index": "index.html", 
     "main": "main.ts", 
     "polyfills": "polyfills.ts", 
     "test": "test.ts", 
     "tsconfig": "tsconfig.app.json", 
     "prefix": "bm-", 
     "environmentSource": "environments/environment.ts", 
     "environments": { 
     "main": "environments/environment.ts" 
     } 
    } 
    ], 
    "lint": [ 
    { 
     "project": "src/tsconfig.app.json" 
    } 
    ], 
    "defaults": { 
    "styleExt": "css", 
    "component": { 
    } 
    }, 
    "warnings": { 
    "typescriptMismatch": false 
    } 
} 

は、どのように私は何が間違って起こっている/何が起こっているかをデバッグすることができますか?

+0

バージョンが変更されている可能性があります。 –

+0

私のような問題は見つかりませんでした。少なくともまだ。 –

+0

誰かがAngular CLI Github [repo](https://github.com/angular/angular-cli/issues/8505)でこの問題を報告しました。これはおそらく関連していますか? –

答えて

0

@Kevin REDのおかげで、以下の簡単な解決方法で問題を解決しました。後

"scripts": { 
    "prod": "ng build --prod --aot false" 
} 

::前

"scripts": { 
    "prod": "ng build --prod --aot false --build-optimizer=false" 
} 

私は(npmjs-build-optimizer)今build-optimizerの機能が何であるかわからないんだけど、私はtrueに設定した場合、私は受け取りますエラー。 falseに設定すると動作します。

関連する問題