-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed as not planned
Closed as not planned
Copy link
Description
Describe the bug
Remote form() functions return the same instance from their for() methods when not client-side rendering. All forms using the same key will initially use the form action for the first form to use the key.
The expected behavior is that each form function has its own instance cache (so for example, an updatePost and deletePost form could each refer to the same post.id). This is how for() seems to behave during CSR, but not during SSR, which affects environments where CSR or JavaScript are disabled.
Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-qfi3gy8i
Inspecting the second form element reveals that it has the same action as the first form. Changing the value of csr in +page.js and refreshing corrects this.
Logs
System Info
From repro terminal:
Binaries:
Node: 20.19.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
svelte: ^5.25.0 => 5.38.3Severity
annoyance
Metadata
Metadata
Assignees
Labels
No labels