Skip to content

Improve exception reporting #29114

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

Open
5 tasks done
EvgenyMuryshkin opened this issue Dec 21, 2018 · 2 comments
Open
5 tasks done

Improve exception reporting #29114

EvgenyMuryshkin opened this issue Dec 21, 2018 · 2 comments
Labels
Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output
Milestone

Comments

@EvgenyMuryshkin
Copy link

EvgenyMuryshkin commented Dec 21, 2018

Search Terms

Crash, Maximum call stack size exceeded, fork-ts-checker-webpack-plugin

Suggestion

Improve crash logs by dumping statements, file names, line number and everything that might help to identify faulty statement.

I just upgraded packages and toolchain for large rect\typescript project.
I am using webpack with fork-ts-checker-webpack-plugin for type checks.

Plugin works fine with 3.1.6 and crashing with 3.2.2. Does not work with 3.3.0-dev.20181220 as well.

I found that dev version 3.2.0-dev.20181030 works ok, and 3.2.0-dev.20181031 is crashing.

Here is a crash log

RangeError: Maximum call stack size exceeded
    at resolveNameHelper (C:\code\spkg\web\node_modules\typescript\lib\typescript.js:31504:35)
    at resolveName (C:\code\spkg\web\node_modules\typescript\lib\typescript.js:31502:20)
    at resolveEntityName (C:\code\spkg\web\node_modules\typescript\lib\typescript.js:32353:26)
    at resolveTypeReferenceName (C:\code\spkg\web\node_modules\typescript\lib\typescript.js:38055:20)
    at getTypeFromTypeReference (C:\code\spkg\web\node_modules\typescript\lib\typescript.js:38240:30)
    at getTypeFromTypeNode (C:\code\spkg\web\node_modules\typescript\lib\typescript.js:39667:28)
    at getConstraintFromTypeParameter (C:\code\spkg\web\node_modules\typescript\lib\typescript.js:37898:72)
    at fillMissingTypeArguments (C:\code\spkg\web\node_modules\typescript\lib\typescript.js:37447:33)
    at getTypeFromClassOrInterfaceReference (C:\code\spkg\web\node_modules\typescript\lib\typescript.js:37999:78)

Use Cases

It is rather impossible to identify faulty statements manually. I cannot distill what exactly is causing that, so detailed exception logging would be very helpfull

Examples

[Exception evaluating c:/code/example.tsx ]
[class: ABC]
[method: func()]
[expression: a = b + c; ]

RangeError: Maximum call stack size exceeded
at resolveNameHelper (C:\code\spkg\web\node_modules\typescript\lib\typescript.js:31504:35)
at resolveName (C:\code\spkg\web\node_modules\typescript\lib\typescript.js:31502:20)

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.
@j-oliveras
Copy link
Contributor

j-oliveras commented Dec 21, 2018

The callstack seems the same as #28873 (see second post).

The crashes caused be assertion violations can be possible to make something like proposed, but on exceptions like Maximum call stack size exceeded (and any other javascript runtime exception) you has no control about it.

@EvgenyMuryshkin
Copy link
Author

The callstack seems the same as #28873 (see second post).

The crashes caused be assertion violations can be possible to make something like proposed, but on exceptions like Maximum call stack size exceeded (and any other javascript runtime exception) you has no control about it.

I did a quick fix, it does not crash in my case, please review and apply if it did not break anything else

EvgenyMuryshkin@9f88c2f

Thanks

@weswigham weswigham added Bug A bug in TypeScript Needs Investigation This issue needs a team member to investigate its status. Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output labels Dec 25, 2018
@RyanCavanaugh RyanCavanaugh removed the Needs Investigation This issue needs a team member to investigate its status. label Mar 7, 2019
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output
Projects
None yet
Development

No branches or pull requests

4 participants