I know this has probably been mentioned many times. The error I get is res.WriteHead is not a function. I used to get this error before when I would have localhost opened in more than one browser. I resolved that issue simply by running only one instance of the app. Now, every time I make a change to the code while the Netlify development server is running, the server crashes with for-mentioned error.
I am using VS Code, and so I thought maybe the issue is related to the editor.
Tried running development server in separate CMD window, issue persists.
I let it re-compile without switching between windows or opening browser, it would still crash.
Sometimes it compiles, but then it crashes immediately afterwards.
I run it again, it compiles and again it crashes.
Basically, it keeps crashing all the time and I think it has something to do with client side, because if I only load the Netlify function in the browser, it doesn’t crash upon changes.
I have pinged the devs internally. However, I’m not sure if/when they will take a look at this issue. CLI-issues are not handled by Support, so I’ll leave it for the devs to decide when they wish to take this up and investigate. Any follow-ups would mostly happen in that issue.