sveltejs / vite-plugin-svelte

Svelte plugin for http://vitejs.dev/
MIT License
844 stars 103 forks source link

link to correct source in error page #699

Closed weepy closed 1 year ago

weepy commented 1 year ago

Describe the bug

Currently the error pages do not link through to the correct page

Screenshot 2023-07-27 at 11 40 22

the link is just relative to the project "/src/lib/components/ProjectMain.svelte:127:17" - but it needs the but it needs the file:// prefix plus the location of the project.

I know it must be possible since with the svelte inspector it's possible to open the relevant component with a click.

Reproduction URL

https://github.com

Reproduction

I didn't create a repro since it happens on all repos

Logs

No response

System Info

Chrome, MacOs, VSCode
eltigerchino commented 1 year ago

Not sure if related, but cmd + click on the link in the terminal output doesn't open the file either (due to the / in the beginning?)

6:07:33 PM [vite] Error when evaluating SSR module /src/routes/+page.svelte: failed to import "/src/routes/Counter.svelte"
|- 

Internal server error: /src/routes/Counter.svelte:21:35 Unexpected token
  Plugin: vite-plugin-svelte
  File: /src/routes/Counter.svelte:21:35 # clicking this link

With the / prefix File not found with the / prefix in VS Code Without the / prefix File found without the / prefix in VS Code Reproduction: https://stackblitz.com/edit/sveltejs-kit-template-default-dz3q17?description=The%20default%20SvelteKit%20template,%20generated%20with%20create-svelte&title=SvelteKit%20Default%20Template