Skip to content

fix: return no-JS form submissions to the submitting page when an action returns json()#2245

Merged
birkskyum merged 4 commits into
solidjs:mainfrom
birkskyum:fix-issue-1976
Jul 26, 2026
Merged

fix: return no-JS form submissions to the submitting page when an action returns json()#2245
birkskyum merged 4 commits into
solidjs:mainfrom
birkskyum:fix-issue-1976

Conversation

@birkskyum

Copy link
Copy Markdown
Member

Without JavaScript, a form posting to an action that returns json() or reload() got a 302 with no Location header, leaving the browser parked on /_server?id=.... These responses carry a value rather than a destination, so handleNoJS never set a redirect target.

  • Fall back to the referer when a returned Response has no Location
  • Unwrap customBody() into the flash cookie so useSubmission().result matches the JS path (it previously serialized the Response to {})
  • Fall back to the app root instead of throwing when there is no usable referer, and guard the flash input against an empty argument list

Adds a no-JS e2e suite covering json(), reload(), redirect(), and a plain return. The first two fail on main and pass here; the latter two were already correct.

@changeset-bot

changeset-bot Bot commented Jul 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 47e581d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solidjs/start Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify

netlify Bot commented Jul 26, 2026

Copy link
Copy Markdown

Deploy Preview for solid-start-landing-page ready!

Name Link
🔨 Latest commit 47e581d
🔍 Latest deploy log https://app.netlify.com/projects/solid-start-landing-page/deploys/6a664b415faee70008b79d23
😎 Deploy Preview https://deploy-preview-2245--solid-start-landing-page.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented Jul 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@solidjs/start@2245

commit: 47e581d

# Conflicts:
#	packages/start/src/fns/handler.ts
@birkskyum birkskyum added the Start 2.x targeting SolidStart 2.x versions label Jul 26, 2026
@birkskyum
birkskyum merged commit 27fca88 into solidjs:main Jul 26, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Start 2.x targeting SolidStart 2.x versions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug?]: return json() in action is not SSR ready

2 participants