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

nicer error logging #11291

Open
Rich-Harris opened this issue Dec 13, 2023 · 4 comments
Open

nicer error logging #11291

Rich-Harris opened this issue Dec 13, 2023 · 4 comments
Milestone

Comments

@Rich-Harris
Copy link
Member

Describe the problem

errors encountered during build (e.g. when reading config, or when a page fails to render) are kinda ugly. pretty sure we could make them way nicer quite easily

Describe the proposed solution

nicer errors

Alternatives considered

No response

Importance

nice to have

Additional Information

No response

@Rich-Harris Rich-Harris added this to the 2.0 milestone Dec 13, 2023
@dummdidumm
Copy link
Member

Ugly in what sense? And what would make them nicer?

@Rich-Harris
Copy link
Member Author

Stuff like this:

image

Showing a stack trace that is purely internal SvelteKit stuff is totally unnecessary — the user can't do anything with it, we should just print a bold red message.

@dummdidumm
Copy link
Member

For certain errors like the options validation that makes sense, for others having the stack trace - even if it leads into internals - is very helpful. You get something to start at.

@brunnerh
Copy link
Member

brunnerh commented Sep 4, 2024

Stack trace aside, the path to the file causing the build error should be printed.
The messages can be rather useless sometimes, e.g.

CompileError: Block was left open

This could be anywhere.

Broke something among dozens of components and had to start the build itself in debug mode to find out which component was actually responsible (via a breakpoint in compileSvelte within the Vite plugin).

Looks like svelte-check can help out as well, it points to the file and shows the exact location. The build output should ideally do the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants