Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[2.0 rc.13 + next] 304 format header overwrites cached GET representation

Closed
#3,897 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
web-dev

Research direction

Investigate how respond from @solidjs/web handles 304 responses. The bug is that a 304 response's format header overwrites the cached GET representation's body format, causing the decoder to consume the wrong format. Look for where 304 responses are constructed and how headers are merged with cached bodies, then ensure the cached representation's format is preserved.

Written by the indexing model from the issue text.

Description

Describe the bug

Browser-managed conditional GET should replay cached {value:17}. Both client fetches see 200, but the second decoded result is undefined.

Your Example Website or App

Standalone reproduction

Steps to Reproduce the Bug or Issue
  1. Use the source below with the selected Solid build (complete setup is linked above).
import { getRequestEvent, respond } from "@solidjs/web";
export const calls: (string | null)[] = [];

export function read() {
  const headers = {
    etag: '"constant"',
    "cache-control": "private, max-age=0, must-revalidate",
  };
  const conditional = getRequestEvent()!.request.headers.get("if-none-match");
  calls.push(conditional);
  // Call this GET twice in Chrome. Chrome adds If-None-Match itself.
  // The second decoded value is undefined, despite cached { value: 17 }.
  return conditional === '"constant"'
    ? new Response(null, { status: 304, headers })
    : respond({ value: 17 }, { headers });
}
  1. Register read as a GET server function named conditional. From a Chrome page, call GET(createServerReference("conditional"))() twice. Chrome sends If-None-Match on the second request; application code sets no conditional header.
Expected behavior

Expected: Both decoded results are { value: 17 }.
Actual: The second result is undefined, although Chrome replays the cached body as status 200.

Platform
  • Solid: solid-js / @solidjs/web next at 3086f1b77cd7b0431d3a7f768c2984c335758633; comparison 2.0.0-rc.13. Signals, compiler and diagnostics match the selected Solid build.
  • OS: macOS 26.6.2 (25G83); browser cases: system Google Chrome 155.0.8059.40. Server-only/type checks run in Bun 1.4.2.
  • Builds/comparison: Development and production fail on HEAD and rc.13; HEAD also fails with observe (production runtime plus optional instrumentation).
Additional context

A 304 response reuses the cached body. Replacing its representation header without replacing the body makes the decoder consume the wrong format.

Development additionally warns that a scripted call returned 304, despite the browser-generated conditional request.

Related: #3101, #3134

Full automated reproduction

One-command setup, run and expected output.

Copy the standalone folder into a fresh Bun project. The visible source above is executed by these tests; the additional files supply the required HTTP, compilation, and browser setup.

bun init -y
bun add [email protected] @solidjs/[email protected] @solidjs/[email protected] @solidjs/[email protected] @solidjs/[email protected]
bun add -d playwright
bun run link-head.ts /absolute/path/to/built/solid
BUILD_MODE=development bun test ./repro.test.ts

The link command selects a built Solid HEAD checkout; omit it for rc.13. Repeat with BUILD_MODE=production for the production comparison. Browser tests use system Google Chrome.

Dominant language
TypeScript
Stars
36.1k
Forks
1.1k
Avg merge
11h 25m
Merged PRs (30d)
345

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from solidjs/solid

All issues in solidjs/solid

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.