Skip to content

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

Open
birkskyum wants to merge 1 commit into
solidjs:mainfrom
birkskyum:fix-issue-1976
Open

fix: return no-JS form submissions to the submitting page when an action returns json()#2245
birkskyum wants to merge 1 commit 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: cac5d18

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 cac5d18
🔍 Latest deploy log https://app.netlify.com/projects/solid-start-landing-page/deploys/6a655c62f968320008fd772d
😎 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: cac5d18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant