Module not found: Can't resolve 'next/web-vitals'

I am getting this error

Module not found: Can't resolve 'next/web-vitals'

I want to use **useReportWebVitals **from next/web-vitals.

Reference: Optimizing: Analytics

I am using next: 12.0.8 & react: 17.0.2

Note: I am using pages router in Next App

I tried removing node_modules, package-lock, .next and re-installing it I also tried clearing the cache.

What am I doing wrong?

Your response will be helpful. Thank you

Upvotes: 1

Views: 738

Answers (1)

Philip Su
Philip Su

Reputation: 113

I believe next/web-vitals was introduced in next v13.3.0, and so you'll likely need to upgrade if you want to use that.

Here's the release tag that shows it.

Upvotes: 0

Related Questions