Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update +error.svelte file template in vscode extension #2637

Open
amr3k opened this issue Dec 25, 2024 · 0 comments · May be fixed by #2638
Open

Update +error.svelte file template in vscode extension #2637

amr3k opened this issue Dec 25, 2024 · 0 comments · May be fixed by #2638
Labels
feature request New feature or request good first issue Good for newcomers

Comments

@amr3k
Copy link

amr3k commented Dec 25, 2024

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 amr3k added the bug Something isn't working label Dec 25, 2024
@jasonlyu123 jasonlyu123 added feature request New feature or request good first issue Good for newcomers and removed bug Something isn't working labels Dec 25, 2024
@amr3k amr3k linked a pull request Dec 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants