Hi,
I have followed all the steps in the Speed Insights Quickstart:
- I have enabled Speed Insights in my Project Settings.
- I have installed the
@vercel/speed-insights
package. - I have added a
/src/routes/+layout.ts
file to my SvelteKit app:
import { injectSpeedInsights } from '@vercel/speed-insights/sveltekit';
injectSpeedInsights();
- I have committed and pushed that change to my repo at Github and can see that it was deployed to Vercel in my project’s “Deployments” tab.
But, for some reason, I do not see the /_vercel/speed-insights/script.js
script inside the body tag of any page on my site.
I do have a server-side +layout.server.ts
file as well as a universal +layout.ts
, but, according to the SvelteKit docs, this should be OK: " If a route contains both universal and server load
functions, the server load
runs first."
I previously tried calling injectSpeedInsights()
in my server-side +layout.server.ts
, and, strangely, it worked for a little while, and I got some initial Speed Insights data, but it has since stopped working.
I feel like I’m missing something obvious, so any suggestions on how to troubleshoot this would be very welcome.
Thanks in advance,
Michael