Open
Description
step 1: Run
npm install web-vitals@latest
I found the web-vitals have changed its export variables; resulting in a web-vital.js crash with the latest updates.
Step 2: change the file "reportWebVitals"
// reportWebVitals.ts
import { onCLS, onFCP, onLCP, onTTFB } from 'web-vitals';
const reportWebVitals = (onPerfEntry?: (metric: any) => void) => {
if (onPerfEntry && typeof onPerfEntry === 'function') {
onCLS(onPerfEntry);
onFCP(onPerfEntry);
onLCP(onPerfEntry);
onTTFB(onPerfEntry);
}
};
export default reportWebVitals;
The code above would resolve the web-vitals issues with the latest update.