language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

Update `+error.svelte` file template in vscode extension

Open amr3k opened this issue 1 year ago • 0 comments

Describe the bug

When using the extension to generate a new +error.svelte file it gives this output:

<script lang="ts">
    import { page } from '$app/stores';
</script>

<h1>{$page.status}: {$page.error?.message}</h1>

This uses the deprecated $app/stores module

Reproduction

In VSCode open the file explorer, hover over any directory in src/routes and right click, choose SvelteKit Files > SvelteKit: Create +error.svelte, then open the newly created file and notice the deprecation notice over page import.

Expected behaviour

It should use this template instead:

<script lang="ts">
    import { page } from '$app/state';
</script>

<h1>{page.status}: {page.error?.message}</h1>

Where it uses $app/state module instead of $app/stores and treat page as a state instead of a store, so no $ sign

System Info

  • OS: Linux
  • IDE: VSCode
  • v109.4.0

Which package is the issue about?

Svelte for VS Code extension

Additional Information, eg. Screenshots

No response

amr3k avatar Dec 25 '24 07:12 amr3k