Form remote function broken if a field name contains dashes
Open
Beginner friendly
Nobody has claimed this yet.
forms
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the bug
A field name containing dashes like my-field-name causes the form submission to fail.
Reproduction
https://stackblitz.com/edit/sveltejs-kit-form-dash-bug?file=src%2Froutes%2F%2Bpage.svelte
Logs
Uncaught (in promise) Error: Invalid path field-with-dash
at split_path (form-utils.js?v=f53a3d90:74:9)
at set_nested_value (form-utils.js?v=f53a3d90:22:19)
at convert_formdata (form-utils.js?v=f53a3d90:61:3)
at convert (form.svelte.js?v=f53a3d90:90:17)
at handle_submit (form.svelte.js?v=f53a3d90:105:17)
at HTMLFormElement.<anonymous> (form.svelte.js?v=f53a3d90:295:36)
System Info
System:
OS: macOS 15.5
CPU: (8) arm64 Apple M2
Memory: 79.02 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.12.0 - ~/.nvm/versions/node/v22.12.0/bin/node
npm: 9.6.4 - /opt/homebrew/bin/npm
pnpm: 10.18.3 - /opt/homebrew/bin/pnpm
bun: 1.3.0 - ~/.bun/bin/bun
Browsers:
Chrome: 141.0.7390.108
Safari: 18.5
npmPackages:
@sveltejs/adapter-auto: ^6.1.0 => 6.1.1
@sveltejs/kit: ^2.43.2 => 2.47.3
@sveltejs/vite-plugin-svelte: ^6.2.0 => 6.2.1
svelte: ^5.39.5 => 5.41.4
vite: ^7.1.7 => 7.1.12
Severity
annoyance
Additional Information
No response
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.
Research direction
Start with the form-utils.js stack-trace entry points, especially split_path, set_nested_value, and convert_formdata, then reproduce the failure using the linked StackBlitz example with a dashed field name. Done means form submission succeeds for names such as my-field-name without the Invalid path error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100