@@ -13,12 +13,12 @@ export async function webVitals({ route, options, sendToAnalytics }) {
13
13
14
14
try {
15
15
// eslint-disable-next-line @typescript-eslint/no-explicit-any
16
- const { getCLS , getFID , getLCP , getTTFB , getFCP } = await import ( 'web-vitals' ) . then ( ( r : any ) => r . default || r )
17
- getFID ( metric => sendToAnalytics ( context , metric , options ) )
18
- getTTFB ( metric => sendToAnalytics ( context , metric , options ) )
19
- getLCP ( metric => sendToAnalytics ( context , metric , options ) )
20
- getCLS ( metric => sendToAnalytics ( context , metric , options ) )
21
- getFCP ( metric => sendToAnalytics ( context , metric , options ) )
16
+ const { onCLS , onFID , onLCP , onTTFB , onFCP } = await import ( 'web-vitals' ) . then ( ( r : any ) => r . default || r ) as typeof import ( 'web-vitals' )
17
+ onFID ( metric => sendToAnalytics ( context , metric , options ) )
18
+ onTTFB ( metric => sendToAnalytics ( context , metric , options ) )
19
+ onLCP ( metric => sendToAnalytics ( context , metric , options ) )
20
+ onCLS ( metric => sendToAnalytics ( context , metric , options ) )
21
+ onFCP ( metric => sendToAnalytics ( context , metric , options ) )
22
22
}
23
23
catch ( err ) {
24
24
logError ( err )
0 commit comments