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

SvelteKit development mode generates error messages. #31

Open
andriytyurnikov opened this issue Dec 9, 2023 · 3 comments
Open

SvelteKit development mode generates error messages. #31

andriytyurnikov opened this issue Dec 9, 2023 · 3 comments

Comments

@andriytyurnikov
Copy link

npm run dev
...
3:49:46 AM [vite] ✨ new dependencies optimized: @vercel/speed-insights/sveltekit
3:49:46 AM [vite] ✨ optimized dependencies changed. reloading
Error: Not found: /_vercel/speed-insights/vitals
    at resolve (/node_modules/@sveltejs/kit/src/runtime/server/respond.js:483:13)
    at resolve (/node_modules/@sveltejs/kit/src/runtime/server/respond.js:277:5)
    at #options.hooks.handle (/node_modules/@sveltejs/kit/src/runtime/server/index.js:49:56)
    at Module.respond (/node_modules/@sveltejs/kit/src/runtime/server/respond.js:274:40)
@smart
Copy link

smart commented Dec 16, 2023

I see this as well. I'm on sveltekit2.0 if that matters.

@smart
Copy link

smart commented Dec 16, 2023

Interesting the README says to put the initialization in your +layout.svelte file but the example has it in +layout.ts

layout.svelte is correct, since it needs to be in the markup. I just wrapped in a dev check to disable it in development.

@feugy
Copy link
Member

feugy commented Jan 12, 2024

Hello and thank you for the bug report.
I've fixed the README: the best way to use injectSpeedInsights() function is in the +layout.ts/js file (which will be run on server side), as per our docs

However, I'm not seeing any error in console.
Could you please provide the version of @vercel/speed-insights and sveltekit that you're using?

Thanks a million.

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

3 participants