SvelteKit development mode generates error messages.
andriytyurnikov opened this issue · 3 comments
andriytyurnikov commented
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 commented
I see this as well. I'm on sveltekit2.0 if that matters.
smart commented
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 commented
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.