Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module resolution warnings under Yarn PnP: Unable to resolve path to module '@vercel/analytics/react'.eslintimport/no-unresolved #128

Open
bitjson opened this issue Jan 25, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@bitjson
Copy link

bitjson commented Jan 25, 2024

In this project, we're seeing the same warning from ESLint as is described in #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.

@andy3520
Copy link

+1

@feugy
Copy link
Member

feugy commented Feb 21, 2024

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!

@feugy feugy added the bug Something isn't working label Feb 21, 2024
@paulbuechner
Copy link

Getting: ESLint: Missing file extension "mjs" for "@vercel/analytics/react"(import/extensions)... version 1.1.4 was working just fine...

@tobiaslins
Copy link
Collaborator

@paulbuechner which version are you on now?

@paulbuechner
Copy link

paulbuechner commented Mar 4, 2024

I'm on latest 1.2.2

Doing // eslint-disable-next-line import/extensions for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants