2

I am getting below error after running ionic cordova run ios --prod command. I am using ionic 3 and want to run my on ios emulator.

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)
1
  • I am not sure what was the reason this caused by but I simply went to previous commit and started working in that and reset the latest commit so things started to work.
    – null
    Commented Dec 22, 2017 at 1:33

1 Answer 1

4

Latish answer, but this can be caused by double declaring the same variable and poorly declaring it in a component for instance:

export class MyComponent implements OnInit {

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

Note the second headerList declaration with the colon and not the equals. I see even fairly modern IDEs do not report this problem. Removing the second declaration kills the error.

Also to note, that once you get the 1st error, then the compiler will not restart correctly in watch mode. You should CTRL-C it and then start it again.

This issue was present for me in 2.4.2.

2
  • I also faced a similar issue. The problem was with me declaring an array without a proper type: theArray : [] = [] Commented Feb 20, 2019 at 9:41
  • 1
    great, it's the typical issue difficult to figure out because the error message is not so clear. Only rollback code can be of help until you figure it out. Thank you!
    – DLara
    Commented Mar 3, 2019 at 3:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.