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

NodeJS JSON Stringify circular reference issue #127

Open
tjrhodes opened this issue Aug 30, 2021 · 1 comment
Open

NodeJS JSON Stringify circular reference issue #127

tjrhodes opened this issue Aug 30, 2021 · 1 comment

Comments

@tjrhodes
Copy link

Hi,

I've got a login script that used to work in a project I'm resurecting. I've got everything compiling using newer tink_web from haxelib. However when rejecting a promise containing an OutgoingResponse I'm getting a node error at runtime.

TypeError: Converting circular structure to JSON

The OutgoingResponse that causes the error does indeed contain a circulare reference:

{ header: { statusCode: 200, reason: 'OK', protocol: 'HTTP/1.1', fields: [] }, body: { retainCount: 0, value: { value: [Object] } } }

There value referes to itself which looks to be the cause of the problem. My OutgoingResponse is created like this:

var failedResponse = new OutgoingResponse(new ResponseHeader(200, "OK", null), 'false');

Any ideas? Will try the success side of the Promise in the auth script to see if it's response suffers a similar fate ;)

Cheers, Tom.

@kevinresol
Copy link
Member

Please kindly provide a compilable snippet so we can reproduce and understand your problem. I guess you are somehow trying to jsonify a tink.io.Source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants