Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug Failure. False expression in TS 2.9 #24577

Closed
egoroof opened this issue Jun 1, 2018 · 10 comments
Closed

Debug Failure. False expression in TS 2.9 #24577

egoroof opened this issue Jun 1, 2018 · 10 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@egoroof
Copy link

egoroof commented Jun 1, 2018

TypeScript Version: 2.9.1

Search Terms: Module build failed: Error: Debug Failure. False expression. lastLocation.kind 273

Code

// hard to do a *self-contained* demonstration of the problem :(

Expected behavior:
Should compile without fail :)

Actual behavior:
Just updated typescript from 2.8.4 to 2.9.1 and got this error:

ERROR in ./node_modules/2gl/src/Buffer.js
Module build failed: Error: Debug Failure. False expression.
    at resolveNameHelper (path\node_modules\typescript\lib\typescript.js:27846:30)
    at resolveName (path\node_modules\typescript\lib\typescript.js:27600:20)
    at resolveEntityName (path\node_modules\typescript\lib\typescript.js:28415:26)
    at resolveEntityName (path\node_modules\typescript\lib\typescript.js:28423:35)
    at resolveTypeReferenceName (path\node_modules\typescript\lib\typescript.js:33678:20)
    at getTypeFromTypeReference (path\node_modules\typescript\lib\typescript.js:33839:30)
    at getTypeFromTypeNode (path\node_modules\typescript\lib\typescript.js:35132:28)
    at Object.map (path\node_modules\typescript\lib\typescript.js:2025:29)
    at getTypeFromUnionTypeNode (path\node_modules\typescript\lib\typescript.js:34271:54)
    at getTypeFromTypeNode (path\node_modules\typescript\lib\typescript.js:35144:28)
    at getTypeOfVariableOrParameterOrProperty (path\node_modules\typescript\lib\typescript.js:30950:41)
    at getTypeOfSymbol (path\node_modules\typescript\lib\typescript.js:31174:24)
    at checkPropertyAccessExpressionOrQualifiedName (path\node_modules\typescript\lib\typescript.js:42269:53)
    at checkPropertyAccessExpression (path\node_modules\typescript\lib\typescript.js:42224:20)
    at checkExpressionWorker (path\node_modules\typescript\lib\typescript.js:45590:28)
    at checkExpression (path\node_modules\typescript\lib\typescript.js:45536:42)
    at checkExpressionWithContextualType (path\node_modules\typescript\lib\typescript.js:45371:26)
    at checkApplicableSignature (path\node_modules\typescript\lib\typescript.js:43018:25)
    at chooseOverload (path\node_modules\typescript\lib\typescript.js:43510:26)
    at resolveCall (path\node_modules\typescript\lib\typescript.js:43420:26)
    at resolveCallExpression (path\node_modules\typescript\lib\typescript.js:43635:20)
    at resolveSignature (path\node_modules\typescript\lib\typescript.js:43871:28)
    at getResolvedSignature (path\node_modules\typescript\lib\typescript.js:43914:26)
    at checkCallExpression (path\node_modules\typescript\lib\typescript.js:44001:29)
    at checkExpressionWorker (path\node_modules\typescript\lib\typescript.js:45599:28)
    at checkExpression (path\node_modules\typescript\lib\typescript.js:45536:42)
    at path\node_modules\typescript\lib\typescript.js:42679:21
    at Object.forEach (path\node_modules\typescript\lib\typescript.js:1792:30)
    at resolveUntypedCall (path\node_modules\typescript\lib\typescript.js:42678:20)
    at resolveErrorCall (path\node_modules\typescript\lib\typescript.js:42685:13)
    at resolveCallExpression (path\node_modules\typescript\lib\typescript.js:43604:24)
    at resolveSignature (path\node_modules\typescript\lib\typescript.js:43871:28)
    at getResolvedSignature (path\node_modules\typescript\lib\typescript.js:43914:26)
    at checkCallExpression (path\node_modules\typescript\lib\typescript.js:44001:29)
    at checkExpressionWorker (path\node_modules\typescript\lib\typescript.js:45599:28)
    at checkExpression (path\node_modules\typescript\lib\typescript.js:45536:42)
     @ ./src/map/gpuStorage.ts 3:0-32 114:25-31 115:26-32
     @ ./src/map/index.ts
     @ ./src/map/ui.ts
     @ ./src/index.ts

We use webpack@4 with ts-loader@4 and got this error. It happens with node8 and node10 on windows, macos and linux. It compiles without error in typescript 2.8, 2.7 etc.

I went to resolveNameHelper (\node_modules\typescript\lib\typescript.js:27843) and find the assert line:

 ts.Debug.assert(lastLocation.kind === 273 /* SourceFile */);

I've added a condition before it:

if (lastLocation.kind !== 273) {
    console.log(lastLocation.kind);
}

And got 296. I don't know what it means but tell me how I can help further.

@ghost
Copy link

ghost commented Jun 1, 2018

That kind is JSDocTypedefTag, so the error probably involves a @typedef somewhere in your code.

@ghost ghost self-assigned this Jun 1, 2018
@egoroof
Copy link
Author

egoroof commented Jun 1, 2018

Yeah, removing @typedef from ./node_modules/2gl/src/Buffer.js fix the problem - Compiled successfully

@mhegazy mhegazy added the Bug A bug in TypeScript label Jun 1, 2018
@mhegazy mhegazy added this to the TypeScript 2.9.2 milestone Jun 1, 2018
@ghost ghost closed this as completed in #24585 Jun 1, 2018
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Jun 2, 2018
@Snesi
Copy link

Snesi commented Jun 6, 2018

I'm getting the same error, but I have no idea how to fix it. I do not have any @typedef in the code.

I also just started getting this error after updating from 2.8.4 to 2.9.1, and I am using webpack 4 with tsloader.

This is the error I'm getting:

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

@mhegazy
Copy link
Contributor

mhegazy commented Jun 6, 2018

Fix should be in typescript@next today, can you give this a quick try and confirm that it is indeed fixed?

@Snesi
Copy link

Snesi commented Jun 7, 2018

Yeah! That worked 😃

@mattheworiordan
Copy link

mattheworiordan commented Jun 14, 2018

We have this same issue reported to us and I can reproduce locally with Typescript 2.9.2, 2.9.1 and even 3.0.0-dev*. But on 2.8.4 everything works fine.

ERROR in ./node_modules/ably/browser/static/ably-commonjs.js
Module build failed (from ./node_modules/ts-loader/index.js):
Error: Debug Failure. False expression.
    at getJSDocTags (/Users/mattheworiordan/Projects/Ably/forks/ably-webpack-typescript/node_modules/typescript/lib/typescript.js:13197:22)
    at getFirstJSDocTag (/Users/mattheworiordan/Projects/Ably/forks/ably-webpack-typescript/node_modules/typescript/lib/typescript.js:13205:24)
    at Object.getJSDocTypeTag (/Users/mattheworiordan/Projects/Ably/forks/ably-webpack-typescript/node_modules/typescript/lib/typescript.js:13154:19)
    at checkParenthesizedExpression (/Users/mattheworiordan/Projects/Ably/forks/ably-webpack-typescript/node_modules/typescript/lib/typescript.js:45628:56)
    at checkExpressionWorker (/Users/mattheworiordan/Projects/Ably/forks/ably-webpack-typescript/node_modules/typescript/lib/typescript.js:45676:28)
    at checkExpression (/Users/mattheworiordan/Projects/Ably/forks/ably-webpack-typescript/node_modules/typescript/lib/typescript.js:45609:42)
    at checkBinaryLikeExpression (/Users/mattheworiordan/Projects/Ably/forks/ably-webpack-typescript/node_modules/typescript/lib/typescript.js:45155:29)
    at checkBinaryExpression (/Users/mattheworiordan/Projects/Ably/forks/ably-webpack-typescript/node_modules/typescript/lib/typescript.js:45147:20)
    at checkExpressionWorker (/Users/mattheworiordan/Projects/Ably/forks/ably-webpack-typescript/node_modules/typescript/lib/typescript.js:45702:28)
    at checkExpression (/Users/mattheworiordan/Projects/Ably/forks/ably-webpack-typescript/node_modules/typescript/lib/typescript.js:45609:42)

Sadly no reference is given to the location of the False expression, and no @typedef is used in ably-commonjs.js.

@mhegazy do you have any suggestions on how we can try and identify what part of the file is causing this issue so that we can fix / raise a suitable issue?

@ghost
Copy link

ghost commented Jun 14, 2018

@mattheworiordan That has nothing in common with this issue besides being an assertion failure, so I made a new issue for it: #24963

@mattheworiordan
Copy link

mattheworiordan commented Jun 14, 2018 via email

renehamburger added a commit to renehamburger/blinx.js that referenced this issue Aug 17, 2018
to avoid microsoft/TypeScript#24577,
which failed tests locally
@christopher-francisco
Copy link

I have this problem using:

info "typescript@3.1.6" has binaries:
   - tsc
   - tsserver
✨  Done in 4.58s.

It happens on a file where I use both require.requireActual() and import (cause it's a Jest mock file)

@ghost
Copy link

ghost commented Nov 12, 2018

@chris-fran Could you create a new issue and provide a sample file that will reproduce it?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

5 participants