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
Currently, it seems that Svelte 5 is partially supported and console.log(...) works as long as a component does not use any snippets ({#snippet mySnippet()}...{/snippet} + {@render mySnippet()}) or 'native' TypeScript within the markup (supported since Svelte 5.0.0-next.9, sveltejs/svelte#9482). Whenever one appears within a .svelte file, Console Ninja no longer injects any logging functions into the code generated by Vite (noticeable when saving a file with and without a snippet and looking at the HMR code sent to the browser).
This does not work; I added an exclamation mark to the last line to make the TypeScript linter happy. The page renders correctly in the browser, but Console Ninja no longer injects nor logs anything within this file:
<svelte:optionsrunes={true} />
<scriptlang="ts">
console.log('hello log output'); // <-- Output does not appear in VSCodeconst items = [{ name: 'world' }];
</script>
<h1>Hello</h1>
<!-- Added `!` after `items[0]` to suppress the 'Object is possibly undefined' error -->
<inputtype="text"bind:value={items[0]!.name} />
Neither does this; A simple snippet:
<svelte:optionsrunes={true} />
<scriptlang="ts">
console.log('hello'); // <-- Output does not appear in VSCode
</script>
<h1>Hello</h1>
{#snippethello(name)}
Hello {name}
{/snippet}
{@renderhello('Etienne')}
Nor this; an (unnecessary) type cast within the markup:
<svelte:optionsrunes={true} />
<scriptlang="ts">
console.log('hello'); // <-- Output does not appear in VSCode
</script>
<h1>Hello</h1>
<!-- TypeScript type cast -->
<inputtype="text"value={"hello world"asstring} />
I'm running:
VSCode 1.89.0
Console Ninja 1.0.319
TypeScript 5.4.5
Vite 5.2.11
Svelte 5.0.0-next.123
SvelteKit 2.5.7
The text was updated successfully, but these errors were encountered:
Describe the feature you'd like.
Currently, it seems that Svelte 5 is partially supported and
console.log(...)
works as long as a component does not use any snippets ({#snippet mySnippet()}...{/snippet}
+{@render mySnippet()}
) or 'native' TypeScript within the markup (supported since Svelte 5.0.0-next.9, sveltejs/svelte#9482). Whenever one appears within a .svelte file, Console Ninja no longer injects any logging functions into the code generated by Vite (noticeable when saving a file with and without a snippet and looking at the HMR code sent to the browser).This works:
This does not work; I added an exclamation mark to the last line to make the TypeScript linter happy. The page renders correctly in the browser, but Console Ninja no longer injects nor logs anything within this file:
Neither does this; A simple snippet:
Nor this; an (unnecessary) type cast within the markup:
I'm running:
The text was updated successfully, but these errors were encountered: