Open colinlienard opened 1 month ago
When defining an Action with explicit parameter types, the compiler still infers the parameters as any, leading to type errors when accessing properties:
any
But this seems to happen only in the IDE because when running svelte-check there are no errors.
svelte-check
https://github.com/colinlienard/svelte-5-repro in src/App.svelte
src/App.svelte
Property 'foo' does not exist on type 'unknown'
System: OS: macOS 14.6.1 CPU: (8) arm64 Apple M2 Memory: 505.70 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node Yarn: 1.22.21 - ~/.nvm/versions/node/v20.11.0/bin/yarn npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm pnpm: 9.0.6 - ~/.nvm/versions/node/v20.11.0/bin/pnpm bun: 1.1.26 - ~/.nvm/versions/node/v20.11.0/bin/bun Browsers: Chrome: 128.0.6613.138 Safari: 17.6 npmPackages: svelte: 5.0.0-next.246 => 5.0.0-next.246
annoyance
Experiencing this too... Very strange bug, as I don't see anything wrong with Action's declaration.
Action
Describe the bug
When defining an Action with explicit parameter types, the compiler still infers the parameters as
any
, leading to type errors when accessing properties:But this seems to happen only in the IDE because when running
svelte-check
there are no errors.Reproduction
https://github.com/colinlienard/svelte-5-repro in
src/App.svelte
Logs
System Info
Severity
annoyance