learn.svelte.dev icon indicating copy to clipboard operation
learn.svelte.dev copied to clipboard

Error messages should indicate where the error happened

Open florestankorp opened this issue 2 years ago • 5 comments

Describe the problem

I'm doin the tutorial and forgot to either remove the second quotation mark or to insert one before the curly braces <img src={src}" />

I just started using Svelte and I'm seeing this a lot that errors don't point me directly to where they occurred: image

Describe the proposed solution

Something like:

Error: "Unexpected end of input" in App.svelte [5]
<img src={src}" />
             ^

Alternatives considered

VS Code provides this IntelliSense error: Expected > svelte (unexpected-token)

This would also be acceptable as long as I can tell in which component and on which line I should be looking :)

Importance

i cannot use svelte without it

florestankorp avatar Jul 30 '22 17:07 florestankorp

The compiler itself does reveal information about that. There are a few different things that could be going on here. I don't know whether this is a learn.svelte.dev-specific issue, or whether it's a Vite plugin/overlay issue, or what.

Conduitry avatar Jul 30 '22 18:07 Conduitry

I'm seeing this sort of thing locally as well. @dominikg Is this something that you would expect the Vite plugin to support? (Is that where this information would be coming from?)

Conduitry avatar Jul 30 '22 18:07 Conduitry

It's working fine for me in a Vite project: image

Maybe it's an issue with learn.svelte.dev

bluwy avatar Jul 31 '22 03:07 bluwy

Yes, this looks like the setup in learn.svelte.dev being a bit special. If i remember correctly there's more than one instance instance and if the error is happening on the other one it might cause that.

dominikg avatar Jul 31 '22 09:07 dominikg

Transferring to the learn.svelte.dev repo.

Conduitry avatar Jul 31 '22 12:07 Conduitry