Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

typescript, error: "Debug Failure. False Expression" at forEachIdentifierInEntityName, typescript.js:24094:26

Tags:

typescript

Got this strange error when upgraded Typescript version from 2.8.4 to 2.9.2:

ERROR in ./js/main.ts
Module build failed (from ./node_modules/ts-loader/index.js):
Error: Debug Failure. False expression.
at forEachIdentifierInEntityName (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:24094:2
at bindPropertyAssignment (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:24044:17)
at bindStaticPropertyAssignment (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:24029:13
at bindSpecialPropertyAssignment (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:24020:1
at bindWorker (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:23669:29)
at bind (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:23560:13)
at visitNode (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:14777:24)
at Object.forEachChild (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:15021:24)
at bindEachChild (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:22352:16)
at bindChildrenWorker (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:22434:21)
at bindChildren (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:22322:17)
at bind (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:23571:21)
at C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:22328:94
at bindEach (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:22344:21)
at bindEachFunctionsFirst (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:22328:13)
at bindChildrenWorker (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:22426:21)
at bindChildren (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:22322:17)
at bindContainer (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:22270:17)
at bind (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:23574:21)
at bindSourceFile (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:21935:17)
at Object.bindSourceFile (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:21876:9)
at initializeTypeChecker (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:51156:20)
at Object.createTypeChecker (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:27045:9)
at Object.getTypeChecker (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:78949:79)
at synchronizeHostData (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:107271:21)
at Object.getEmitOutput (C:\devel\autostream-web\node_modules\typescript\lib\typescript.js:107671:13)
at Object.getEmitOutput (C:\devel\autostream-web\node_modules\ts-loader\dist\instances.js:187:41)
at getEmit (C:\devel\autostream-web\node_modules\ts-loader\dist\index.js:196:37)
at successLoader (C:\devel\autostream-web\node_modules\ts-loader\dist\index.js:34:11)
at Object.loader (C:\devel\autostream-web\node_modules\ts-loader\dist\index.js:21:12)

Here is my tsconfig.json:

{
  "compilerOptions": {
  "sourceMap": true,
  "noImplicitAny": true,
  "module": "es6",
  "target": "es6",
  "lib": [
    "es2017",
    "dom"
   ],   
  "allowJs": true,
  "allowSyntheticDefaultImports" : true,
  "experimentalDecorators": true
  }
}

Question: how can I get suitable error message and what am I doing wrong? And, I also saw this question, but I'm not satisfied with the solution and explanation - I need to use at least the same target and do not roll it back to 'es3', which is the default.

like image 433
Anton Pilyak Avatar asked Jun 13 '18 11:06

Anton Pilyak


2 Answers

A web search finds TypeScript bug 24111, which is fixed in TypeScript 3.0.1. Try upgrading TypeScript. If the problem is still there, follow the process to file a new TypeScript bug.

like image 153
Matt McCutchen Avatar answered Nov 20 '22 16:11

Matt McCutchen


Try to execute "npm i typescript" in the same directory as your project.

like image 1
Oleg Avatar answered Nov 20 '22 15:11

Oleg