Speed Insights does not support React Router v7

:red_question_mark: Question

We are developing a service using React Router v7 and deploying it on Vercel.
Currently, it seems that Vercel Speed Insights only supports Next.js, React, and Remix, and not React Router v7.

How can we properly use Speed Insights with React Router v7?


:gear: Current vs Expected Behavior

  • @vercel/speed-insights/next and @vercel/speed-insights/remix:
    :cross_mark: Causes build errors and cannot be used.
  • @vercel/speed-insights/react:
    :white_check_mark: No build errors, but appears to lack SSR (Server-Side Rendering) support.

We expected a working integration for React Router v7, especially for applications using SSR.


:wrench: Reproduction Steps

  1. Set up a React project with React Router v7
  2. Deploy to Vercel
  3. Try integrating each of the following:
  • @vercel/speed-insights/next
  • @vercel/speed-insights/remix
  • @vercel/speed-insights/react
  1. Observe the results:
  • Next/Remix versions throw build errors
  • React version builds, but lacks SSR compatibility

:package: Project Information

  • Framework: React 19 + React Router v7
  • Deployment: Vercel
  • Speed Insights packages tested:
    • @vercel/speed-insights/react
    • @vercel/speed-insights/next
    • @vercel/speed-insights/remix

Please let us know the recommended approach or any workaround for using Speed Insights with React Router v7.

Thank you!

The /remix package is the one with the functionality you want but since the underlying packages were renamed in the Remix v2 to React Router v7 switch, that’s what causes the build errors. I’ll ping our team responsible to see if we can get a new /react-router package published, but no immediate ETA on that

If you need to be unblocked on this immediately, the package is open source and you can see here how the Remix adapter builds on top of the speed insights react package, so you could either fork or pull the code into your own codebase