Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module not found: Error: Can't resolve 'web-vitals' in '/app/src'

Everything works perfectly fine on my local computer, but once I deployed my react app in heroku, it starts to give this error.

The things I have tried already,

  1. npm install web-vitals --save-dev
  2. delete node module and npm install
  3. downgrade web-vitals from 2.1.4 to 2.1.2
  4. npm update

but no matter what I do, my heroku keeps on crashing and keeps on showing this same error

like image 772
JAMES SUBBA Avatar asked Mar 03 '26 07:03

JAMES SUBBA


1 Answers

Issue

The error "Module not found: Error: Can't resolve 'web-vitals'" is because of missing web-vitals package, make sure the web-vitals package is installed in devDependencies.

Install web-vitals

To install the web-vitals, just run the following command in the root directory of the project and re-run the server

npm install --save-dev web-vitals

If the error is not resolved, try to delete your node_modules and package-lock.json (not package.json) files, re-run npm install

like image 100
Kamran Rizwan Avatar answered Mar 05 '26 03:03

Kamran Rizwan