analytics
analytics copied to clipboard
Module resolution warnings under Yarn PnP: `Unable to resolve path to module '@vercel/analytics/react'.eslintimport/no-unresolved`
In this project, we're seeing the same warning from ESLint as is described in https://github.com/vercel/analytics/issues/18, but eslint-import-resolver-typescript
is installed and working correctly for other packages. I suspect the issue is happening because we use Yarn PnP.
Currently, we're disabling import/no-unresolved
for the import:
// eslint-disable-next-line import/no-unresolved
import { Analytics } from '@vercel/analytics/react';
But we're also seeing a warning (and maybe new issues with source maps) during production builds. E.g. the warning in a recent CI build:
.yarn/cache/@vercel-analytics-npm-1.1.2-cdbea53b32-01d2d4b9a1.zip/node_modules/@vercel/analytics/dist/react/index.js (1:0) Error when using sourcemap for reporting an error: Can't resolve original location of error.
These warnings also don't seem to be resolved by unplugging the package.
Other than these warnings, analytics otherwise seem to be working.
+1
Hello. We recently changed the package exports. I don't know if it'll solve this particular issue, but it may have an effect. Would you mind trying version 1.2.2? Thanks!
Getting: ESLint: Missing file extension "mjs" for "@vercel/analytics/react"(import/extensions)... version 1.1.4 was working just fine...
@paulbuechner which version are you on now?
I'm on latest 1.2.2
Doing // eslint-disable-next-line import/extensions
for now