generate-thumbnail: `Error serializing return value: TypeError: Converting circular structure to JSON
See original GitHub issueIn this sample: https://github.com/firebase/functions-samples/tree/master/generate-thumbnail
We routinely see the error Error serializing return value: TypeError: Converting circular structure to JSON
in the logs during function execution.
We’ve been trying to isolate exactly the point of failure, but testing and debugging with cloud functions is a bit tricky.
Logging it here in case someone at Firebase has an idea.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:6
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Cloud Functions for Firebase - Error serializing return value
The function seems to be working properly, however in the logs I keep seeing this Error serializing return value: TypeError: Converting circular ......
Read more >Converting Circular Structure to JSON - Career Karma
It is an error that can be thrown when attempting to change a value that cannot be changed or when using a value...
Read more >swift json get request from url Code Example - Grepper
ofType: "json"),. 5. let jsonData = try String(contentsOfFile: bundlePath).data(using: .utf8) {. 6. return jsonData. 7. } 8. } catch {. 9. print(error).
Read more >TypeError: Converting circular structure to JSON - YouTube
JSON.stringifyType Error : Converting circular structure to JSON -- starting at object with constructor 'Topology' | property 's' - object ...
Read more >Dealing with "TypeError: Converting circular structure to JSON ...
JavaScript structures that include circular references can't be serialized with a"plain" JSON.stringify . Example:
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That code is a noop from just returning
ref.transaction
(That it’s a noop is actually part of the acceptance test for a Promise implementation).The problem you’re running into is that the promised value that
ref.transaction
returns isn’t serializeable as JSON. The easiest way to fix this (before we fix it in the Firebase SDK) is to transform the value to something like null.That
() => null
transforms any success ofTransactionResult
to a success oftypeof null
@inlined thanks for the workaround!