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
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!
Most helpful comment
Another duplicate issue. Ping @DanielRosenwasser, can you please deploy the fix?