Typescript: Playground: Diagnostic with related information causes "Uncaught Error: Converting circular structure to JSON"

Created on 31 Jul 2018  Β·  8Comments  Β·  Source: microsoft/TypeScript


TypeScript Version: playground


Search Terms: playground "Converting circular structure to JSON" "cyclic object value"

Code

let Number = 42;
let x: number = "oops";

Expected behavior: Compile error on the second line.

Actual behavior: No compile error shown. In the developer console, "Uncaught Error: Converting circular structure to JSON" (Chrome) or "Error: cyclic object value" (Firefox).

Playground Link: link

Related Issues: none

Bug Fixed Website

Most helpful comment

Another duplicate issue. Ping @DanielRosenwasser, can you please deploy the fix?

All 8 comments

I debugged this a bit. Looks like the uncaught error occurs any time the worker tries to return an error with "related information". The "related information" message contains a file object which contains cyclic data structures. The file object of the root diagnostic message is undefined; I assume something is clearing it out, though I wasn't able to find the code that is doing that. I guess that code needs to be updated to clear file objects of the related messages too.

For reference, the source of the TypeScript playground integration is https://github.com/Microsoft/monaco-typescript

Thanks mhegazy. I found the code and am drafting a fix.

Please help me finish Microsoft/monaco-typescript#21. IMO this bug should be high priority since it's a major breakage in a widely used service; I ran into it twice yesterday while using the playground to investigate other TypeScript issues.

Another duplicate issue. Ping @DanielRosenwasser, can you please deploy the fix?

Ping @DanielRosenwasser. The broken playground continues to be a drag on my efficiency at helping your users on Stack Overflow. The fix to monaco-typescript was merged a month ago. Can you please make sure it is deployed along with the coming upgrade to TypeScript 3.1, if not sooner?

@RyanCavanaugh By changing the milestone, do you really mean you intend to leave the playground broken for another 2 months, or were you just editing the issues in bulk without looking at them?

This should be fixed already. Sorry about the delay!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fwanicka picture fwanicka  Β·  3Comments

manekinekko picture manekinekko  Β·  3Comments

DanielRosenwasser picture DanielRosenwasser  Β·  3Comments

Roam-Cooper picture Roam-Cooper  Β·  3Comments

kyasbal-1994 picture kyasbal-1994  Β·  3Comments