You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The TS template uses empty state for the in Page.svelte which causes no issues.
The JS template uses null which is throwing type errors in the built in sveltekit check script.
Proposed fix would be to remove null from 'user' state in .../frameworks/sveltekit/template/cli/js/Page.svelte and align with the TS template using empty state
ie
** Disclaimer** This information might be inaccurate, due to it being generated automatically
The issue can be fixed by modifying the Page.svelte template in the SvelteKit JavaScript template. The file should be updated to match the TypeScript template's approach: Location: frameworks/sveltekit/template/cli/js/Page.svelte Change: svelte let user = $state(null); To: svelte let user = $state(); And update the logout handler from: svelte onLogout={() => (user = null)} To: svelte onLogout={() => (user = undefined)} This aligns with the TypeScript template and resolves the type checking errors in SvelteKit projects.
About Greptile
This response provides a starting point for your research, not a precise solution.
Help us improve! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
The TS template uses empty state for the in Page.svelte which causes no issues.
The JS template uses null which is throwing type errors in the built in sveltekit check script.
Proposed fix would be to remove null from 'user' state in .../frameworks/sveltekit/template/cli/js/Page.svelte and align with the TS template using empty state
ie
Reproduction link
https://github.com/brettearle/storybook_sveltekit_bug
Reproduction steps
This should reproduce these errors
System
Storybook Environment Info:
System:
OS: Linux 6.12 Pop!_OS 22.04 LTS
CPU: (8) x64 Intel(R) Core(TM) i7-10610U CPU @ 1.80GHz
Shell: 5.8.1 - /usr/bin/zsh
Binaries:
Node: 22.14.0 - ~/.nvm/versions/node/v22.14.0/bin/node
npm: 10.9.2 - ~/.nvm/versions/node/v22.14.0/bin/npm <----- active
pnpm: 10.8.1 - ~/.nvm/versions/node/v22.14.0/bin/pnpm
Browsers:
Chrome: 135.0.7049.114
npmPackages:
@storybook/addon-essentials: ^8.6.12 => 8.6.12
@storybook/addon-svelte-csf: ^5.0.0-next.0 => 5.0.0
@storybook/blocks: ^8.6.12 => 8.6.12
@storybook/experimental-addon-test: ^8.6.12 => 8.6.12
@storybook/svelte: ^8.6.12 => 8.6.12
@storybook/sveltekit: ^8.6.12 => 8.6.12
@storybook/test: ^8.6.12 => 8.6.12
storybook: ^8.6.12 => 8.6.12
Additional context
I'm happy to sort this out if proposed fix is accepted
The text was updated successfully, but these errors were encountered: