You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
They don't work when using the IIFE (e.g. via https://unpkg.com/[email protected]/dist/web-vitals.iife.js) since var webVitals is reported as {}
This is due to the .d.ts being a module (export/import in the .d.ts), therefore only window.webVitals works as expected but using just the webVitals variable reports an error.
import type { onCLS, onINP, onLCP } from 'web-vitals'
...
TS1479: The current file is a CommonJS module whose imports will produce require calls; however, the referenced file is an ECMAScript module and cannot be imported with require. Consider writing a dynamic import(web-vitals)' call instead.
Would be great if the types could be added to https://github.com/DefinitelyTyped/DefinitelyTyped
The text was updated successfully, but these errors were encountered: