Typescript: "Debug failure" without any details when upgrading to 3.8.2.

Created on 25 Feb 2020  路  4Comments  路  Source: microsoft/TypeScript


TypeScript Version: 3.8.2


Search Terms: debug failure.

Code: nothing specific. Happens in an Ember app.

Expected behavior:
My app builds successfully on TypeScript 3.7.5. I expect that upgrading to 3.8.2 does not break the build or at least crashes with a meaningful error.

Actual behavior:
Build crashes with:

C:\Code\kaliber5\tujspk-frontend\node_modules\typescript\lib\typescript.js:98632
                throw e;
                ^

Error: Debug Failure.
    at Object.assertDefined (C:\Code\kaliber5\tujspk-frontend\node_modules\typescript\lib\typescript.js:2227:24)
    at C:\Code\kaliber5\tujspk-frontend\node_modules\typescript\lib\typescript.js:39435:34
    at Object.filter (C:\Code\kaliber5\tujspk-frontend\node_modules\typescript\lib\typescript.js:513:31)
    at serializeAsClass (C:\Code\kaliber5\tujspk-frontend\node_modules\typescript\lib\typescript.js:39433:48)
    at serializeSymbolWorker (C:\Code\kaliber5\tujspk-frontend\node_modules\typescript\lib\typescript.js:39164:29)
    at serializeSymbol (C:\Code\kaliber5\tujspk-frontend\node_modules\typescript\lib\typescript.js:39105:38)
    at C:\Code\kaliber5\tujspk-frontend\node_modules\typescript\lib\typescript.js:39080:25
    at Map.forEach (<anonymous>)
    at visitSymbolTable (C:\Code\kaliber5\tujspk-frontend\node_modules\typescript\lib\typescript.js:39079:33)
    at symbolTableToDeclarationStatements (C:\Code\kaliber5\tujspk-frontend\node_modules\typescript\lib\typescript.js:38950:17)

Related Issues:
There are numerous issues with Debug failure, but all of them have some additional error message such as:

Error: Debug Failure. in 'Object.assertDefined' during 'completionEntryDetails'

Mine doesn't. 馃様


tsconfig.json:

{
  "compilerOptions": {
    "target": "es2017",
    "allowJs": true,
    "moduleResolution": "node",
    "allowSyntheticDefaultImports": true,
    "noImplicitAny": true,
    "noImplicitThis": true,
    "alwaysStrict": true,
    "strictNullChecks": true,
    "strictPropertyInitialization": true,
    "noFallthroughCasesInSwitch": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noImplicitReturns": true,
    "noEmitOnError": false,
    "noEmit": true,
    "inlineSourceMap": true,
    "inlineSources": true,
    "baseUrl": ".",
    "module": "es6",
    "skipLibCheck": true,
    "paths": {
      "uni-frontend/tests/*": [
        "tests/*"
      ],
      "uni-frontend/mirage/*": [
        "mirage/*"
      ],
      "uni-frontend/*": [
        "app/*",
        "lib/ember-cli-yadda-steps/app/*",
        "lib/ember-kaliber5-loading/app/*"
      ],
      "ember-cli-yadda-steps": [
        "lib/ember-cli-yadda-steps/addon"
      ],
      "ember-cli-yadda-steps/*": [
        "lib/ember-cli-yadda-steps/addon/*"
      ],
      "ember-cli-yadda-steps/test-support": [
        "lib/ember-cli-yadda-steps/addon-test-support"
      ],
      "ember-cli-yadda-steps/test-support/*": [
        "lib/ember-cli-yadda-steps/addon-test-support/*"
      ],
      "ember-kaliber5-loading": [
        "lib/ember-kaliber5-loading/addon"
      ],
      "ember-kaliber5-loading/*": [
        "lib/ember-kaliber5-loading/addon/*"
      ],
      "ember-kaliber5-loading/test-support": [
        "lib/ember-kaliber5-loading/addon-test-support"
      ],
      "ember-kaliber5-loading/test-support/*": [
        "lib/ember-kaliber5-loading/addon-test-support/*"
      ],
      "fetch": [
        "node_modules/ember-fetch"
      ],
      "*": [
        "types/*"
      ]
    },
    "experimentalDecorators": true
  },
  "include": [
    "app/**/*",
    "tests/**/*",
    "types/**/*",
    "lib/ember-cli-yadda-steps/**/*",
    "lib/ember-kaliber5-loading/**/*",
    "mirage/**/*"
  ]
}
Bug Fix Available

Most helpful comment

@RyanCavanaugh @lolmaus I'm pretty certain this is unrelated to Babel.

I've narrowed it down to a relatively small reproduction in https://github.com/dfreeman/typescript-3.8-debug-failure

The failure seems to have appeared in the 20191228 dev build (everything works as expected in the previous release from 20191224). It looks like it has something to do with the type definitions from DT for @ember/component when used in a .js file with allowJs: true, but that's as far as I got. It also only happens in a watched build.

All 4 comments

Seems to be caused by Babel. Thx to @nickschot for pointing to https://github.com/babel/babel/pull/11129

@RyanCavanaugh @lolmaus I'm pretty certain this is unrelated to Babel.

I've narrowed it down to a relatively small reproduction in https://github.com/dfreeman/typescript-3.8-debug-failure

The failure seems to have appeared in the 20191228 dev build (everything works as expected in the previous release from 20191224). It looks like it has something to do with the type definitions from DT for @ember/component when used in a .js file with allowJs: true, but that's as far as I got. It also only happens in a watched build.

https://github.com/typed-ember/ember-cli-typescript/issues/1103

Just to reference the ember-cli-typescript repo.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MartynasZilinskas picture MartynasZilinskas  路  3Comments

bgrieder picture bgrieder  路  3Comments

zhuravlikjb picture zhuravlikjb  路  3Comments

Roam-Cooper picture Roam-Cooper  路  3Comments

Antony-Jones picture Antony-Jones  路  3Comments