Duplicates
Latest version
Current behavior 😯
POST /_server returns 500 Internal Server Error
Expected behavior 🤔
POST /_server returns 200 OK
Steps to reproduce 🕹
Steps:
- Install
todomvc example using npm create solid
- Modify src/lib/api.ts#addTodo action to include the following line:
throw new Error('Oops! Something went wrong 😅');
- Open the page http://localhost:3000/ and add a todo item in UI.
Context 🔦
Console log shows an error:
[h3] [unhandled] TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["X-Error"]
at ServerResponse.setHeader (node:_http_outgoing:702:3)
It seams we should encode error message text here: packages/start/src/runtime/server-handler.ts#setHeader(h3Event,"X-Error",error.message)
Related:
Your environment 🌎
Node: v23.5.0
SolidStart: v1.0.11