I couldn’t replicate this error with my test project. My first thought is the framework picker is switched to SvelteKit instead of Next.js for you in the docs and you ended up with import { injectSpeedInsights } from '@vercel/speed-insights/sveltekit'; instead of import { SpeedInsights } from '@vercel/speed-insights/next';.
If that’s not it, I’m happy to take a closer look. Would you be able to share a minimal reproducible example or code snippets to let me see how your project was set up?