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

Using noUnusedLocals crashes version 2.7 #21491

Closed
dasa opened this issue Jan 30, 2018 · 9 comments
Closed

Using noUnusedLocals crashes version 2.7 #21491

dasa opened this issue Jan 30, 2018 · 9 comments
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@dasa
Copy link

dasa commented Jan 30, 2018

TypeScript Version: 2.7.1-insiders.20180127

Is not an issue with typescript@next. It'd be great to have this fix in the 2.7 release since this is a regression.

Search Terms:

noUnusedLocals, crash

Code

See attached.

Expected behavior:

tsc --noUnusedLocals SceneServiceFactory.ts returns expected errors in 2.6.

Actual behavior:

/usr/local/lib/node_modules/typescript/lib/tsc.js:59815
                throw e;
                ^

Error: Debug Failure.
    at checkUnusedClassMembers (/usr/local/lib/node_modules/typescript/lib/tsc.js:35731:38)
    at checkUnusedIdentifiers (/usr/local/lib/node_modules/typescript/lib/tsc.js:35617:29)
    at checkSourceFileWorker (/usr/local/lib/node_modules/typescript/lib/tsc.js:37887:21)
    at checkSourceFile (/usr/local/lib/node_modules/typescript/lib/tsc.js:37865:13)
    at Object.forEach (/usr/local/lib/node_modules/typescript/lib/tsc.js:260:30)
    at getDiagnosticsWorker (/usr/local/lib/node_modules/typescript/lib/tsc.js:37931:16)
    at getDiagnostics (/usr/local/lib/node_modules/typescript/lib/tsc.js:37908:24)
    at Object.getEmitResolver (/usr/local/lib/node_modules/typescript/lib/tsc.js:20096:17)
    at emitWorker (/usr/local/lib/node_modules/typescript/lib/tsc.js:59757:69)
    at /usr/local/lib/node_modules/typescript/lib/tsc.js:59731:66

SceneServiceFactory.ts.txt

@mhegazy
Copy link
Contributor

mhegazy commented Jan 30, 2018

Fixed by #21343

@mhegazy
Copy link
Contributor

mhegazy commented Jan 30, 2018

for this specific file, the semicolon after setPointCloudNodeAttributes is what is triggering the crash.

@mhegazy mhegazy added Bug A bug in TypeScript Fixed A PR has been merged for this issue labels Jan 30, 2018
@mhegazy mhegazy added this to the TypeScript 2.7.2 milestone Jan 30, 2018
@mhegazy mhegazy self-assigned this Jan 30, 2018
@hiro5id
Copy link

hiro5id commented Jan 31, 2018

I am also getting this crash on typescript 2.7 when compiling on Mac OSX and using the "noUnusedLocals":true setting in tsconfig.json

The crash looks like this:

/app/node_modules/typescript/lib/tsc.js:59841
                throw e;
                ^

Error: Debug Failure.
    at checkUnusedClassMembers (/Users/roberto/dev/3pm-appdirect-nodejs/node_modules/typescript/lib/tsc.js:35757:38)
    at checkUnusedIdentifiers (/Users/roberto/dev/3pm-appdirect-nodejs/node_modules/typescript/lib/tsc.js:35643:29)
    at checkSourceFileWorker (/Users/roberto/dev/3pm-appdirect-nodejs/node_modules/typescript/lib/tsc.js:37913:21)
    at checkSourceFile (/Users/roberto/dev/3pm-appdirect-nodejs/node_modules/typescript/lib/tsc.js:37891:13)
    at getDiagnosticsWorker (/Users/roberto/dev/3pm-appdirect-nodejs/node_modules/typescript/lib/tsc.js:37945:17)
    at Object.getDiagnostics (/Users/roberto/dev/3pm-appdirect-nodejs/node_modules/typescript/lib/tsc.js:37934:24)
    at /Users/roberto/dev/3pm-appdirect-nodejs/node_modules/typescript/lib/tsc.js:59858:85
    at runWithCancellationToken (/Users/roberto/dev/3pm-appdirect-nodejs/node_modules/typescript/lib/tsc.js:59834:24)
    at getSemanticDiagnosticsForFileNoCache (/Users/roberto/dev/3pm-appdirect-nodejs/node_modules/typescript/lib/tsc.js:59848:20)
    at getAndCacheDiagnostics (/Users/roberto/dev/3pm-appdirect-nodejs/node_modules/typescript/lib/tsc.js:60059:26)```

rictic added a commit to Polymer/polymer-analyzer that referenced this issue Jan 31, 2018
rictic added a commit to Polymer/polymer-analyzer that referenced this issue Jan 31, 2018
* Implement strict initialization.

* Remove semicolon that crashes tsc. microsoft/TypeScript#21491

* Use tsc @ 2.71 now that it is out.
@digeff
Copy link

digeff commented Feb 1, 2018

I think I hit the same issue here:
https://ci.appveyor.com/project/roblourens/vscode-chrome-debug-core/build/1.0.374

[00:38:32] Using gulpfile C:\projects\vscode-chrome-debug-core\gulpfile.js
[00:38:32] Starting 'build'...
C:\projects\vscode-chrome-debug-core\node_modules\typescript\lib\typescript.js:74441
throw e;
^
Error: Debug Failure.
at checkUnusedClassMembers (C:\projects\vscode-chrome-debug-core\node_modules\typescript\lib\typescript.js:43598:38)
at checkUnusedIdentifiers (C:\projects\vscode-chrome-debug-core\node_modules\typescript\lib\typescript.js:43482:29)
at checkSourceFileWorker (C:\projects\vscode-chrome-debug-core\node_modules\typescript\lib\typescript.js:46156:21)
at checkSourceFile (C:\projects\vscode-chrome-debug-core\node_modules\typescript\lib\typescript.js:46129:13)
at getDiagnosticsWorker (C:\projects\vscode-chrome-debug-core\node_modules\typescript\lib\typescript.js:46194:17)
at Object.getDiagnostics (C:\projects\vscode-chrome-debug-core\node_modules\typescript\lib\typescript.js:46180:24)
at C:\projects\vscode-chrome-debug-core\node_modules\typescript\lib\typescript.js:74462:85
at runWithCancellationToken (C:\projects\vscode-chrome-debug-core\node_modules\typescript\lib\typescript.js:74425:24)
at getSemanticDiagnosticsForFileNoCache (C:\projects\vscode-chrome-debug-core\node_modules\typescript\lib\typescript.js:74448:20)
at getAndCacheDiagnostics (C:\projects\vscode-chrome-debug-core\node_modules\typescript\lib\typescript.js:74684:26)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! vscode-chrome-debug-core@3.22.4 prepare: gulp build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the vscode-chrome-debug-core@3.22.4 prepare script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\appveyor\AppData\Roaming\npm-cache_logs\2018-02-01T00_38_35_289Z-debug.log
Command exited with code 1

@mhegazy
Copy link
Contributor

mhegazy commented Feb 1, 2018

The fix should be already in typescript@next and in the next 2.7.2 release. give typescript@next a try and let us know if you are still seeing issues.

@mhegazy mhegazy closed this as completed Feb 1, 2018
@digeff
Copy link

digeff commented Feb 1, 2018

That worked. Thanks :)

@jmlee2k
Copy link

jmlee2k commented Feb 1, 2018

We're also experiencing this in 2.6.1 (typescript@next works fine). Is there any way to figure out which file tsc is breaking on?

@mhegazy
Copy link
Contributor

mhegazy commented Feb 1, 2018

for this specific call stack, it is a semicolon after a method or accessor declaration in your class. to know which specific class, consider running under a debugger. node --inspect tsc.js --p <proj>

@jmlee2k
Copy link

jmlee2k commented Feb 1, 2018

Thanks @mhegazy, that worked great! Much better than me trying to find them with a regexp. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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