Error while adding vercel analytics to vite react app

I added vercel analytics to my react project build via vite like:

import { Analytics } from “@vercel/analytics/react”;
import { SpeedInsights } from “@vercel/speed-insights/react”;

ReactDOM.createRoot(document.getElementById(“root”)).render(
<React.StrictMode>





</React.StrictMode>
);

But I am getting this error after deploying to vercel. Attaching image of error.

Hey @ydeveloper77-gmailco. It looks like the @vercel/analytics/react package is missing from your project. Try running npm install @vercel/analytics, make sure the dependency appears in the package.json file, and then start a new deployment. That should remove the error. :slightly_smiling_face:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.