Angular 构建导致错误 type_check_block
Angular build causing error type_check_block
ng 构建后我得到:
√ Browser application bundle generation complete.
Error: Error: Could not resolve [object Object] / undefined
at Scope.resolve (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1318:23)
at Scope.resolve (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1315:36)
at Scope.resolve (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1315:36)
at Scope.resolve (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1315:36)
at Scope.resolve (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1315:36)
at TcbExpressionTranslator.resolveTarget (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1877:35)
at TcbExpressionTranslator.resolve (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1786:29)
at AstTranslator.maybeResolve (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1771:84)
at AstTranslator.translate (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\expression.js:74:33)
at Object.astToTypescript (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\expression.js:55:27)
at TcbExpressionTranslator.translate (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1771:33)
at tcbExpression (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1759:27)
at TcbUnclaimedInputsOp.execute (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:848:32)
at Scope.executeOp (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1428:26)
at Scope.render (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1335:22)
at TcbTemplateBodyOp.execute (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:318:40)
我有以下依赖:
"@angular-devkit/build-angular": "~0.1100.1",
"@angular/cli": "~11.0.1",
"@angular/compiler-cli": "^11.0.0",
"@angular/language-service": "^11.0.0",
"@types/crypto-js": "^4.0.1",
"@types/jasmine": "~3.6.1",
"@types/jasminewd2": "~2.0.8",
"@types/node": "^14.14.7",
“codelyzer”:“^ 6.0.1”,
“茉莉花核心”:“〜3.6.0”,
“茉莉花规范记者”:“~6.0.0”,
“业力”:“〜5.2.3”,
"karma-chrome-launcher": "~3.1.0",
“业力报道-伊斯坦布尔记者”:“~3.0.3”,
“业力茉莉花”:“〜4.0.1”,
"karma-jasmine-html-reporter": "^1.5.4",
“量角器”:“~7.0.0”,
“ts-节点”:“〜9.0.0”,
“tslint”:“~6.1.0”,
“打字稿”:“~4.0.5”
我看到有人遇到了这个问题,因为他不小心从应用程序的导入数组中删除了一个模块。检查我最近的提交后,我注意到我从 app.module.ts
imports
中删除了 FormsModule
。重新添加后,错误消失,我可以再次编译没有问题。
ng 构建后我得到:
√ Browser application bundle generation complete.
Error: Error: Could not resolve [object Object] / undefined
at Scope.resolve (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1318:23)
at Scope.resolve (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1315:36)
at Scope.resolve (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1315:36)
at Scope.resolve (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1315:36)
at Scope.resolve (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1315:36)
at TcbExpressionTranslator.resolveTarget (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1877:35)
at TcbExpressionTranslator.resolve (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1786:29)
at AstTranslator.maybeResolve (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1771:84)
at AstTranslator.translate (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\expression.js:74:33)
at Object.astToTypescript (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\expression.js:55:27)
at TcbExpressionTranslator.translate (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1771:33)
at tcbExpression (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1759:27)
at TcbUnclaimedInputsOp.execute (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:848:32)
at Scope.executeOp (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1428:26)
at Scope.render (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:1335:22)
at TcbTemplateBodyOp.execute (...\node_modules\@angular\compiler-cli\src\ngtsc\typecheck\src\type_check_block.js:318:40)
我有以下依赖: "@angular-devkit/build-angular": "~0.1100.1", "@angular/cli": "~11.0.1", "@angular/compiler-cli": "^11.0.0", "@angular/language-service": "^11.0.0", "@types/crypto-js": "^4.0.1", "@types/jasmine": "~3.6.1", "@types/jasminewd2": "~2.0.8", "@types/node": "^14.14.7", “codelyzer”:“^ 6.0.1”, “茉莉花核心”:“〜3.6.0”, “茉莉花规范记者”:“~6.0.0”, “业力”:“〜5.2.3”, "karma-chrome-launcher": "~3.1.0", “业力报道-伊斯坦布尔记者”:“~3.0.3”, “业力茉莉花”:“〜4.0.1”, "karma-jasmine-html-reporter": "^1.5.4", “量角器”:“~7.0.0”, “ts-节点”:“〜9.0.0”, “tslint”:“~6.1.0”, “打字稿”:“~4.0.5”
我看到有人遇到了这个问题,因为他不小心从应用程序的导入数组中删除了一个模块。检查我最近的提交后,我注意到我从 app.module.ts
imports
中删除了 FormsModule
。重新添加后,错误消失,我可以再次编译没有问题。