gpt4 book ai didi

javascript - Angular 构建调试失败(在 typeToString 处)

转载 作者:行者123 更新时间:2023-11-29 20:58:34 26 4
gpt4 key购买 nike

运行 ionic cordova run ios --prod 命令后出现以下错误。我正在使用 ionic 3 并想在 ios 模拟器上运行。

Error: Debug Failure.
at typeToString (/Users/xafar/Documents/Projects/SeekThisPlace/mobile/node_modules/typescript/lib/typescript.js:28777:22)
at checkVariableLikeDeclaration (/Users/xafar/Documents/Projects/SeekThisPlace/mobile/node_modules/typescript/lib/typescript.js:44893:199)
at checkParameter (/Users/xafar/Documents/Projects/SeekThisPlace/mobile/node_modules/typescript/lib/typescript.js:43030:13)
at Object.forEach (/Users/xafar/Documents/Projects/SeekThisPlace/mobile/node_modules/typescript/lib/typescript.js:1506:30)
at checkSignatureDeclaration (/Users/xafar/Documents/Projects/SeekThisPlace/mobile/node_modules/typescript/lib/typescript.js:43171:16)
at checkConstructorDeclaration (/Users/xafar/Documents/Projects/SeekThisPlace/mobile/node_modules/typescript/lib/typescript.js:43398:13)
at checkSourceElement (/Users/xafar/Documents/Projects/SeekThisPlace/mobile/node_modules/typescript/lib/typescript.js:46712:28)
at Object.forEach (/Users/xafar/Documents/Projects/SeekThisPlace/mobile/node_modules/typescript/lib/typescript.js:1506:30)
at checkClassDeclaration (/Users/xafar/Documents/Projects/SeekThisPlace/mobile/node_modules/typescript/lib/typescript.js:45765:16)
at checkSourceElement (/Users/xafar/Documents/Projects/SeekThisPlace/mobile/node_modules/typescript/lib/typescript.js:46779:28)

最佳答案

Latish answer,但这可能是由于双重声明相同变量在组件中声明不当造成的,例如:

export class MyComponent implements OnInit {

centres : Array<any> = [];
groups: Array<any> = [];
headerList = [];
actions= [];
headerList : []; // <-- This is the culprit
}

请注意第二个 headerList 声明带有冒号而不是等号。我看到即使是相当现代的 IDE 也不会报告这个问题。删除第二个声明会消除错误。

另请注意,一旦出现第一个错误,编译器将无法在监视模式下正确重启。你应该 CTRL-C 它然后重新启动它。

我在 2.4.2 中遇到了这个问题。

关于javascript - Angular 构建调试失败(在 typeToString 处),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47931548/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com