Nodejs bug statusCode vs writeHead
00:15 20 Nov 2025

Can someone please explain to me why my code does not work?

I am trying to add a new user to the existing list.

I converted the chunk to a string, then back to a JS object, then back to JSON.[![enter image description here][1]][1]

Line 173 is giving me an error if I use the code in the image. If I use the statusCode201, no issue. What seems to be the difference? [1]: https://i.sstatic.net/65dK2RTB.png

node.js