-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Handler with code
async (arg) => {
return arg
}
Rejects with error:
{
"stack": "TypeError: Converting circular structure to JSON\n --> starting at object with constructor 'Object'\n | property 'Provider' -> object with constructor 'Object'\n --- property '_context' closes the circle\n at JSON.stringify (<anonymous>)\n at stringify (/node_modules/express/lib/response.js:1150:12)\n at ServerResponse.json (/node_modules/express/lib/response.js:271:14)\n at file:///index.js:77:13\n at Generator.next (<anonymous>)\n at fulfilled (file:///index.js:4:58)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
"message": "Converting circular structure to JSON\n --> starting at object with constructor 'Object'\n | property 'Provider' -> object with constructor 'Object'\n --- property '_context' closes the circle"
}
Workaround:
Use util.inspect:
async (arg) => {
const util = await import('util')
return util.inspect(arg, {depth: 15})
}
Expected Behavior
Handler to return that json
Current Behavior
Handler rejects with error
Steps to reproduce
No response
Environment
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working