-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Description
Describe the bug
When you have a form with no schema, the invalid method is available, but form.fields is of type never, preventing access to the root-level issues.
export const test = form((invalid) => {
throw invalid('testing');
});
test.fields.issues(); // type error
// ^? neverReproduction
Copy this into any *.remote.ts file:
export const test = form((invalid) => {
throw invalid('testing');
});
test.fields.issues(); // type error
// ^? neverIt works, but it has an incorrect type error.
Logs
System Info
System:
OS: macOS 26.0.1
CPU: (16) arm64 Apple M4 Max
Memory: 1.23 GB / 48.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.12.0 - /Users/sillvva/.nvm/versions/node/v22.12.0/bin/node
npm: 10.9.0 - /Users/sillvva/.nvm/versions/node/v22.12.0/bin/npm
pnpm: 10.19.0 - /Users/sillvva/.nvm/versions/node/v22.12.0/bin/pnpm
bun: 1.2.20 - /Users/sillvva/.bun/bin/bun
Browsers:
Firefox: 144.0
Safari: 26.0.1
npmPackages:
@sveltejs/kit: ^2.47.1 => 2.48.4Severity
annoyance
Additional Information
Proposed solution. Change this:
kit/packages/kit/src/exports/public.d.ts
Line 2061 in 9909a29
| fields: Input extends void ? never : RemoteFormFields<Input>; |
To this:
fields: Input extends void
? {
issues(): RemoteFormIssue[] | undefined;
}
: RemoteFormFields<Input>;Metadata
Metadata
Assignees
Labels
No labels