Poor error message when names conflict
See original GitHub issueTypeScript Version: 3.5.2
Search Terms: debug failure unexpected node error message exception
Obviously the following code is incorrect, however I would expect a friendly error message directing the user to the problem, rather than the nasty/ambiguous error message that is currently given: Error: Debug Failure. Unexpected node
.
I ran into this in a large codebase and it took me awhile to find source of the problem.
Code
yarn add @types/lodash
import * as pick from 'lodash/pick';
export const pick = () => pick();
$ tsc
/Users/oliverjash/Development/typescript-playground/node_modules/typescript/lib/tsc.js:73748
throw e;
^
Error: Debug Failure. Unexpected node.
Node 156 was unexpected.
at getDeclarationSpaces (/Users/oliverjash/Development/typescript-playground/node_modules/typescript/lib/tsc.js:46074:41)
at /Users/oliverjash/Development/typescript-playground/node_modules/typescript/lib/tsc.js:46066:84
at Object.forEach (/Users/oliverjash/Development/typescript-playground/node_modules/typescript/lib/tsc.js:217:30)
at getDeclarationSpaces (/Users/oliverjash/Development/typescript-playground/node_modules/typescript/lib/tsc.js:46066:28)
at checkExportsOnMergedDeclarations (/Users/oliverjash/Development/typescript-playground/node_modules/typescript/lib/tsc.js:46009:41)
at checkVariableLikeDeclaration (/Users/oliverjash/Development/typescript-playground/node_modules/typescript/lib/tsc.js:47011:17)
at checkVariableDeclaration (/Users/oliverjash/Development/typescript-playground/node_modules/typescript/lib/tsc.js:47048:20)
at checkSourceElementWorker (/Users/oliverjash/Development/typescript-playground/node_modules/typescript/lib/tsc.js:48787:28)
at checkSourceElement (/Users/oliverjash/Development/typescript-playground/node_modules/typescript/lib/tsc.js:48648:17)
at Object.forEach (/Users/oliverjash/Development/typescript-playground/node_modules/typescript/lib/tsc.js:217:30)
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How To Fix the “409 Conflict” Error (5 Methods) - Kinsta
The "409 conflict" error can be frustrating, but it is actually easy to fix. Learn how to fix the error using 5 different...
Read more >409 Conflict - HTTP - MDN Web Docs
The HTTP 409 Conflict response status code indicates a request conflict with the current state of the target resource.
Read more >TPT04106 Error: Conflicting job names have been specified ...
TPT04106 Error: Conflicting job names have been specified for 'tbuild' command argument : '%s' and '%s'. Explanation: A TPT job can have ...
Read more >Fix conflicting records errors - Google Domains Help
When created records conflict with existing records, or a browser extension misreads fields, you may see error messages. The following are examples of...
Read more >Design-time errors in the Windows Forms Designer
This is an error in the component you just loaded or placed on the form. It indicates that the component did not add...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
🐞 That’s not a normal error message. The compiler actually crashed. It’s 100% a bug. 😄
@sandersn I think I’ve figured out why this error happens, at least in my code. My code:
As you see, there is invalid JSDoc syntax. TS compiler crashed here
typescript\lib\typescript.js:59394
.After JSDoc code was fixed, the error is gone. I hope it will help.