-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Describe the bug
#13999 added better typing for params
that are used when destructuring the $props rune, however it appears this doesn't actually work. I get undefined
when I $inspect params
and the server 500s when I try to access a param.
Reproduction
sv create test
- Choose minimal option
- Choose typescript option
- Skip add-ons
- Use pnpm
- Create a
src/routes/[x]/+page.svelte
file with the following content
<script>
let { params } = $props();
</script>
<p>x: {params.x}</p>
- Run
pnpm dev
- Navigate to http://localhost:5173/test
- Notice the server gives a 500 error
TypeError: Cannot read properties of undefined (reading 'x')
Logs
System Info
System:
OS: Linux 6.6 Ubuntu 24.04.2 LTS 24.04.2 LTS (Noble Numbat)
CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
Memory: 22.29 GB / 31.31 GB
Container: Yes
Shell: 5.9 - /usr/bin/zsh
Binaries:
Node: 22.17.1 - ~/.nvm/versions/node/v22.17.1/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v22.17.1/bin/yarn
npm: 10.9.2 - ~/.nvm/versions/node/v22.17.1/bin/npm
pnpm: 10.13.1 - ~/.nvm/versions/node/v22.17.1/bin/pnpm
npmPackages:
@sveltejs/adapter-auto: ^6.0.0 => 6.0.1
@sveltejs/kit: ^2.22.0 => 2.25.0
@sveltejs/vite-plugin-svelte: ^6.0.0 => 6.1.0
svelte: ^5.0.0 => 5.36.7
vite: ^7.0.4 => 7.0.5
Severity
serious, but I can work around it
Additional Information
No response
Metadata
Metadata
Assignees
Labels
No labels