Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Svelte 5 Error "Not implemented type annotation EmptyStatement" when using snippets with typed parameters

$
0
0

my coworker has got a really strange bug with svelte 5 where doing this works fine

{#snippet test()}<span>Hello world</span>{/snippet}<div>    {@render test()}</div>

Adding parameters to a snippet like so also works (but vscode detects and error because of it not being typed)

{#snippet test(text)}<span>Hello world</span>{/snippet}<div>    {@render test("hello world")}</div>

But adding typed parameters it will give the following error : [plugin:vite-plugin-svelte] Not implemented type annotation EmptyStatement

{#snippet test(text: string)}<span>Hello world</span>{/snippet}<div>    {@render test("hello world")}</div>

Svelte was setup with typescript these are the current typescript compiler options :

"allowJs": true,"checkJs": true,"esModuleInterop": true,"forceConsistentCasingInFileNames": true,"resolveJsonModule": true,"skipLibCheck": true,"sourceMap": true,"strict": true,"moduleResolution": "bundler","noImplicitThis": false

We have tried "strict": false and "noImplicitAny": false but nothing seems to change

This is only the case when declaring and using a snippet within the same file. Child component snippets with parameters work as expected.

We're both running the same versions on node, npm (though i'm using pnpm and he has nvm) all npm packages are exactly the same. Any ideas on where this issue could be coming from ?


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>