Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?]: TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["X-Error"] #1709

Open
2 tasks done
frenzzy opened this issue Jan 9, 2025 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@frenzzy
Copy link
Contributor

frenzzy commented Jan 9, 2025

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

POST /_server returns 500 Internal Server Error

Expected behavior 🤔

POST /_server returns 200 OK

Steps to reproduce 🕹

Steps:

  1. Install todomvc example using npm create solid
  2. Modify src/lib/api.ts#addTodo action to include the following line:
    throw new Error('Oops! Something went wrong 😅');
  3. 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
@frenzzy frenzzy added the bug Something isn't working label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant