I have an express web app that has app.use(express.json())
. I'm testing the integrations with Slack's slash commands, and I had a very basic post function set up:
app.post('/info', (req, res) => {
console.log(req.body);
res.send('Thanks');
});
The issue is whenever my slack app hits /info
, my app throws
TypeError: Converting circular structure to JSON
at stringify (/node_modules/express/lib/response.js:1119:12)
at ServerResponse.json (/node_modules/express/lib/response.js:260:14)
at app.post (app.js:69:9)
Is there a way to fix this error without removing the app.use(express.json())
?
I've seen this answer, however I don't believe it pertains as I can't modify express' express.json()
function. I've also seen this answer, however it seems like that's due to their use of res.json
which I am not using.