wikiのアップグレード手順に従って、angular-cli 1.0.0-rc1に更新しました。AngularCLI rc.1でプロダクションビルドを行うにはどうすればよいですか?
ng serve
を実行すると、アプリが正しく動作します。
ng build
を実行すると、アプリが正常に動作します。
私はng build --target=production --environment=prod
を実行すると、私は、次を得る:
➜ web git:(master) ✗ ng build --target=production --environment=prod
Hash: 1e69750dbc9679bddab0
Time: 69052ms
chunk {0} main.8839163bd6c77300ac2a.bundle.js (main) 1.11 MB {3} [initial] [rendered]
chunk {1} styles.014a26b5c21b6bdedf9e.bundle.css (styles) 440 bytes {4} [initial] [rendered]
chunk {2} scripts.73c5e350c283a9340ddc.bundle.js (scripts) 146 kB {4} [initial] [rendered]
chunk {3} vendor.f208e8b0304d6a96ac3d.bundle.js (vendor) 2.54 MB [initial] [rendered]
chunk {4} inline.1eab99acff53ba884df2.bundle.js (inline) 0 bytes [entry] [rendered]
ERROR in ../api/src/business/dtos/modifier.dto.ts
Module build failed: TypeError: Cannot read property 'text' of undefined
at Object.getTokenPosOfNode (/Users/jmurphy/projects/business/web/node_modules/typescript/lib/typescript.js:6768:71)
at IdentifierObject.TokenOrIdentifierObject.getStart (/Users/jmurphy/projects/business/web/node_modules/typescript/lib/typescript.js:80500:23)
at IdentifierObject.TokenOrIdentifierObject.getText (/Users/jmurphy/projects/business/web/node_modules/typescript/lib/typescript.js:80521:77)
at refactor.findAstNodes.filter (/Users/jmurphy/projects/business/web/node_modules/@ngtools/webpack/src/loader.js:139:44)
at Array.filter (native)
at refactor.findAstNodes.forEach.node (/Users/jmurphy/projects/business/web/node_modules/@ngtools/webpack/src/loader.js:138:14)
at Array.forEach (native)
at _removeDecorators (/Users/jmurphy/projects/business/web/node_modules/@ngtools/webpack/src/loader.js:129:10)
at Promise.resolve.then (/Users/jmurphy/projects/business/web/node_modules/@ngtools/webpack/src/loader.js:292:33)
@ ./src/app/model-labels/model-label.component.ts 3:0-51
@ ./src/$$_gendir/app/app.module.ngfactory.ts
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ../api/src/business/dtos/document.dto.ts
Module build failed: TypeError: Cannot read property 'text' of undefined
at Object.getTokenPosOfNode (/Users/jmurphy/projects/business/web/node_modules/typescript/lib/typescript.js:6768:71)
at IdentifierObject.TokenOrIdentifierObject.getStart (/Users/jmurphy/projects/business/web/node_modules/typescript/lib/typescript.js:80500:23)
at IdentifierObject.TokenOrIdentifierObject.getText (/Users/jmurphy/projects/business/web/node_modules/typescript/lib/typescript.js:80521:77)
at refactor.findAstNodes.filter (/Users/jmurphy/projects/business/web/node_modules/@ngtools/webpack/src/loader.js:139:44)
at Array.filter (native)
at refactor.findAstNodes.forEach.node (/Users/jmurphy/projects/business/web/node_modules/@ngtools/webpack/src/loader.js:138:14)
at Array.forEach (native)
at _removeDecorators (/Users/jmurphy/projects/business/web/node_modules/@ngtools/webpack/src/loader.js:129:10)
at Promise.resolve.then (/Users/jmurphy/projects/business/web/node_modules/@ngtools/webpack/src/loader.js:292:33)
@ ./src/app/document-viewer/document-viewer.component.ts 2:0-51
@ ./src/$$_gendir/app/app.module.ngfactory.ts
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ../api/src/business/dtos/models.dto.ts
Module build failed: TypeError: Cannot read property 'text' of undefined
at Object.getTokenPosOfNode (/Users/jmurphy/projects/business/web/node_modules/typescript/lib/typescript.js:6768:71)
at IdentifierObject.TokenOrIdentifierObject.getStart (/Users/jmurphy/projects/business/web/node_modules/typescript/lib/typescript.js:80500:23)
at IdentifierObject.TokenOrIdentifierObject.getText (/Users/jmurphy/projects/business/web/node_modules/typescript/lib/typescript.js:80521:77)
at refactor.findAstNodes.filter (/Users/jmurphy/projects/business/web/node_modules/@ngtools/webpack/src/loader.js:139:44)
at Array.filter (native)
at refactor.findAstNodes.forEach.node (/Users/jmurphy/projects/business/web/node_modules/@ngtools/webpack/src/loader.js:138:14)
at Array.forEach (native)
at _removeDecorators (/Users/jmurphy/projects/business/web/node_modules/@ngtools/webpack/src/loader.js:129:10)
at Promise.resolve.then (/Users/jmurphy/projects/business/web/node_modules/@ngtools/webpack/src/loader.js:292:33)
@ ./src/app/model-sublabel/model-sublabel.component.ts 1:0-46
@ ./src/$$_gendir/app/app.module.ngfactory.ts
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ../api/src/business/dtos/lens.dto.ts
Module build failed: TypeError: Cannot read property 'text' of undefined
at Object.getTokenPosOfNode (/Users/jmurphy/projects/business/web/node_modules/typescript/lib/typescript.js:6768:71)
at IdentifierObject.TokenOrIdentifierObject.getStart (/Users/jmurphy/projects/business/web/node_modules/typescript/lib/typescript.js:80500:23)
at IdentifierObject.TokenOrIdentifierObject.getText (/Users/jmurphy/projects/business/web/node_modules/typescript/lib/typescript.js:80521:77)
at refactor.findAstNodes.filter (/Users/jmurphy/projects/business/web/node_modules/@ngtools/webpack/src/loader.js:139:44)
at Array.filter (native)
at refactor.findAstNodes.forEach.node (/Users/jmurphy/projects/business/web/node_modules/@ngtools/webpack/src/loader.js:138:14)
at Array.forEach (native)
at _removeDecorators (/Users/jmurphy/projects/business/web/node_modules/@ngtools/webpack/src/loader.js:129:10)
at Promise.resolve.then (/Users/jmurphy/projects/business/web/node_modules/@ngtools/webpack/src/loader.js:292:33)
@ ./src/app/create-lens/create-lens.component.ts 2:0-43
@ ./src/$$_gendir/app/app.module.ngfactory.ts
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in main.8839163bd6c77300ac2a.bundle.js from UglifyJs
Unexpected token: name (FooterComponent) [main.8839163bd6c77300ac2a.bundle.js:7,6]
私は私のアプリは、生産のために正しくコンパイルするために取得するにはどうすればよい
?
更新1: 違反ファイルの例を次に示します。 ColumnTypes.TEXTは公開値です。これらはただのデコレータなので、外部依存関係はありません。ここでも、これは非プロダクションビルドでうまく動作します。
import {autoserialize} from "cerialize";
import {ManyToOne, PrimaryGeneratedColumn, Column, JoinColumn, OneToOne, OneToMany, Table, ColumnTypes, CreateDateColumn} from "./export.dtos";
@Table()
export class DTOModifier {
@PrimaryGeneratedColumn()
@autoserialize id: number;
@Column(ColumnTypes.TEXT, {nullable: true})
@autoserialize label: string;
}
:
static TEXT: ColumnType;
document.dto.tsに問題がある必要があります。ファイルをコンパイルリストから除外してみてください。 – digit
ng build --prod – shammelburg
@autoserializeの後ろに()がありませんか? – philipooo