Start: page route returns 500 when Accept excludes HTML
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- react, typescript
Research direction
Start at packages/start-server-core/src/createStartHandler.ts around lines 558-561, then reproduce the issue with the provided curl commands and Accept headers. Done means non-HTML Accept values return 406 Not Acceptable, while /, browser Accept headers, and an absent header continue returning 200.
Written by the indexing model from the issue text.
Description
Which project does this relate to?
Start
Describe the bug
createStartHandler refuses to render a page route when the request's Accept
header does not allow HTML, and reports that refusal as 500:
A failed content negotiation is a client-side condition, so this should be
406 Not Acceptable. 500 says the server malfunctioned, and nothing did.
Complete minimal reproducer
reproduction doesn't need any custom code
Steps to Reproduce the Bug
Against any Start app, on any page (non-server) route:
curl -i -H 'Accept: application/json' https://example.com/
curl -i -H 'Accept: image/webp' https://example.com/
Both return 500 {"error":"Only HTML requests are supported here"}. Accept: /, a browser Accept, and an absent header all return 200.
Expected behavior
Should return 406 Not Acceptable instead of 500 Server Error.
Screenshots or Videos
No response
Platform
- @tanstack/react-start 1.168.32
- @tanstack/start-server-core 1.169.17 (current latest)
Additional context
No response
- Dominant language
- TypeScript
- Stars
- 15.1k
- Forks
- 1.9k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 136
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from TanStack/router
-
information needed
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
lazyRouteComponent reload guard key collides on Safari, capping stale-deploy recovery at one per tab Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
information needed
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100