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

getJSDocTags ... Debug Failure. False expression. #25935

Closed
burtonator opened this issue Jul 25, 2018 · 12 comments
Closed

getJSDocTags ... Debug Failure. False expression. #25935

burtonator opened this issue Jul 25, 2018 · 12 comments
Labels
Duplicate An existing issue was already created

Comments

@burtonator
Copy link

I get this exception when trying to migrate an existing JS app to TS.

/home/burton/projects/polar-bookshelf/node_modules/typescript/lib/tsc.js:63860
                throw e;
                ^

Error: Debug Failure. False expression.
    at getJSDocTags (/home/burton/projects/polar-bookshelf/node_modules/typescript/lib/tsc.js:10302:22)
    at getFirstJSDocTag (/home/burton/projects/polar-bookshelf/node_modules/typescript/lib/tsc.js:10309:24)
    at Object.getJSDocType (/home/burton/projects/polar-bookshelf/node_modules/typescript/lib/tsc.js:10286:19)
    at getContextualSignature (/home/burton/projects/polar-bookshelf/node_modules/typescript/lib/tsc.js:33934:32)
    at checkFunctionExpressionOrObjectLiteralMethod (/home/burton/projects/polar-bookshelf/node_modules/typescript/lib/tsc.js:36773:43)
    at checkExpressionWorker (/home/burton/projects/polar-bookshelf/node_modules/typescript/lib/tsc.js:37696:28)
    at checkExpression (/home/burton/projects/polar-bookshelf/node_modules/typescript/lib/tsc.js:37629:42)
    at checkBinaryLikeExpression (/home/burton/projects/polar-bookshelf/node_modules/typescript/lib/tsc.js:37246:29)
    at checkBinaryExpression (/home/burton/projects/polar-bookshelf/node_modules/typescript/lib/tsc.js:37238:20)
    at checkExpressionWorker (/home/burton/projects/polar-bookshelf/node_modules/typescript/lib/tsc.js:37717:28)

.. I imagine I have malformed JSDoc tags that I need to resolve but I can't find out which one is causing the problem. I went through and looked at the last .js file from my app it's printing and removed the JSDoc and that didn't resolve the problem.

It would be nice if TSC didn't choke but even just better error handling so I can fix this myself would be nice.

TypeScript Version: 2.9.2

Search Terms:

getJSDocTags " Debug Failure. False expression."

Code
I'm not sure

Expected behavior:

Don't generate this error but at least show me where the problem is happening.

Actual behavior:

Playground Link:

Related Issues:

@ghost
Copy link

ghost commented Jul 25, 2018

The bug is happening due to a jsdoc comment somewhere in your program. You might be able to narrow it down by making a clone of your repository and deleting files until the error no longer happens, then narrow down the particular file that was responsible. Or if you can, you could just share a link to the project.

@ghost ghost added the Needs More Info The issue still hasn't been fully clarified label Jul 25, 2018
@j-oliveras
Copy link
Contributor

Duplicate of #25067?

@ghost
Copy link

ghost commented Jul 25, 2018

May be -- @burtonator Be sure to test with typescript@next to ensure it's not already fixed.

@burtonator
Copy link
Author

Fixed on 3.0.0-rc!

@ghost ghost added Duplicate An existing issue was already created and removed Needs More Info The issue still hasn't been fully clarified labels Jul 25, 2018
@typescript-bot
Copy link
Collaborator

Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.

@mcblum
Copy link

mcblum commented Aug 14, 2018

@andy-ms just seeing this in our project as well, but we're stuck at 2.7.2 due to the deps of @angular/cli. Any idea if there's a way to work around this?

@ghost
Copy link

ghost commented Aug 14, 2018

@mcblum The original issue is #24963. You should be able to fix it by separating duplicate assignments a = b = c into b = c; a = b;.

@mcblum
Copy link

mcblum commented Aug 14, 2018

@andy-ms thanks for the reply. so these issues appear to be related to dependencies of the project. I've created a Pastebin. If you have any ideas, it would be much appreciated!

https://paste.laravel.io/f617665b-bfd9-44fd-96ba-b296cb8b3d5e

Edit: also, these errors are being thrown with TS 3.0.1.

@ghost
Copy link

ghost commented Aug 14, 2018

@mcblum Maybe you could avoid compiling your node_modules with TypeScript and use type declarations instead?

@ghost
Copy link

ghost commented Aug 14, 2018

Also, I don't see any errors running tsc auth0.js --noEmit --strict --allowJs with typescript@3.0 installed, so your build tool may not be using the TypeScript version you think it is. Try getting a repro that just uses tsc.

@mcblum
Copy link

mcblum commented Aug 14, 2018

@andy-ms interesting. I ran ng --version and it shows 3.0.1. When you say avoid compiling, what exactly does that mean? At the moment we're using the standard Angular CLI build process - to be honest, I'm not sure what it's doing behind the curtain.

@ghost
Copy link

ghost commented Aug 14, 2018

You're getting compile errors in files that TypeScript wouldn't normally compile -- by default it doesn't type-check the contents of node_modules unless there's a .d.ts file. I'm not an angular user so you may need to look for an angular help forum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants