sveltejs / sveltejs/kit

Use the Vite error overlay for more errors at dev time

Open
#9,704 2 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

error handling
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the problem

During development, some runtime errors only show a message in the console. For example, if you cause an error in a load function or during rendering of a component, SvelteKit's error page is displayed and you need to look at the dev console to figure out where the error is. New users may not realize that they need to look at the console for this.

It would be nice if the error and stack trace was shown on the page as well.

This was called out as accessibility feedback in https://github.com/sveltejs/svelte/issues/8508#issuecomment-1512662903, though I think surfacing errors better is more broadly applicable.

Describe the proposed solution

Expose runtime errors via Vite's error overlay, similar to how compilation errors are displayed.

Alternatives considered

Do nothing and expect people to keep looking at the dev console.

Importance

nice to have

Additional Information

I'm unclear whether this depends on https://github.com/vitejs/vite/issues/2076 or not - parts of this may be blocked by Vite.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing SvelteKit's development-time error handling and the linked Vite issue 2076 to determine whether runtime overlay support is available or blocked upstream. Done means runtime errors from load functions and component rendering show their error and stack trace in the Vite error overlay instead of only in the dev console.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, vite
Domain
developer-experience, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.