Skip to content
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

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

Closed
mattmccutchen opened this issue Jul 30, 2018 · 8 comments · Fixed by microsoft/monaco-typescript#21
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue Website Deprecated - please forward issue to microsoft/TypeScript-Website

Comments

@mattmccutchen
Copy link
Contributor

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

@mhegazy mhegazy added Bug A bug in TypeScript Website Deprecated - please forward issue to microsoft/TypeScript-Website labels Jul 30, 2018
@mattmccutchen
Copy link
Contributor Author

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.

@mhegazy
Copy link
Contributor

mhegazy commented Jul 31, 2018

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

@mattmccutchen
Copy link
Contributor Author

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

@mattmccutchen mattmccutchen changed the title Playground: Collision with built-in identifier causes "Uncaught Error: Converting circular structure to JSON" Playground: Diagnostic with related information causes "Uncaught Error: Converting circular structure to JSON" Jul 31, 2018
@mattmccutchen
Copy link
Contributor Author

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.

@mattmccutchen
Copy link
Contributor Author

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

@mattmccutchen
Copy link
Contributor Author

mattmccutchen commented Sep 13, 2018

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?

@mattmccutchen
Copy link
Contributor Author

@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?

@DanielRosenwasser
Copy link
Member

This should be fixed already. Sorry about the delay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue Website Deprecated - please forward issue to microsoft/TypeScript-Website
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants