-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Description
Describe the bug
It looks like there's a slight bug in either the typing or the actual value of the issues
field within a remote form. The typing coming in looks like
(property) issues: ({
username: RemoteFormIssue[];
} & {
password: RemoteFormIssue[];
}) | null
but when I inspect the value of form.issues
it's actually {}
. This causes a discrepancy between what Typescript thinks the value can be and what it actually is.
Reproduction
Notice that when the project boots up, the page shows a 500 because of the following error:
TypeError: Cannot read properties of undefined (reading 'at')
at eval (src/routes/+page.svelte:49:101)
at Renderer.child (node_modules/svelte/src/internal/server/renderer.js:122:18)
at Renderer.component (node_modules/svelte/src/internal/server/renderer.js:147:22)
at _page (src/routes/+page.svelte:19:14)
at eval (.svelte-kit/generated/root.svelte:74:7)
at eval (src/routes/+layout.svelte:20:5)
at Renderer.child (node_modules/svelte/src/internal/server/renderer.js:122:18)
at Renderer.component (node_modules/svelte/src/internal/server/renderer.js:147:22)
at _layout (src/routes/+layout.svelte:13:14)
However, if you run npm run check
there are no typescript errors. This is because logInForm.issues
is actually an empty object ({}
) instead of null
like typescript expects.
Logs
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
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:
@sveltejs/adapter-auto: ^6.0.0 => 6.1.0
@sveltejs/kit: ^2.22.0 => 2.42.2
@sveltejs/vite-plugin-svelte: ^6.0.0 => 6.2.0
svelte: ^5.25.0 => 5.39.3
vite: ^7.0.4 => 7.1.6
Severity
annoyance
Additional Information
No response