Skip to content

Improve exception reporting #29114

Open
Open
@EvgenyMuryshkin

Description

@EvgenyMuryshkin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptCrashFor flagging bugs which are compiler or service crashes or unclean exits, rather than bad output

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions