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

All imports must resolve in next.config when running next lint. This prevents monorepos from linting before building dependent packages. #73012

Open
asos-tomp opened this issue Nov 20, 2024 · 0 comments
Labels
bug Issue was opened via the bug report template. Developer Experience Issues related to Next.js logs, Error overlay, etc. Linting Related to `next lint` or ESLint with Next.js.

Comments

@asos-tomp
Copy link

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/damp-sea-q85m6v

To Reproduce

npm run lint

Current vs. Expected behavior

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /project/sandbox/node_modules/some-package/package.json imported from /project/sandbox/next.config.mjs

It should be possible to lint a project without a package being used as a plugin in the next config being built. In monorepo pipelines it's common to lint prior to building all dependent packages.

Running eslint independently in a monorepo does not complain when a package referenced by a file: resolution in package.json points to non-existent files; this is a run-time not a lint-time concern.

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
  Available memory (MB): 4102
  Available CPU cores: 2
Binaries:
  Node: 20.9.0
  npm: 9.8.1
  Yarn: 1.22.19
  pnpm: 8.10.2
Relevant Packages:
  next: 15.0.4-canary.20 // Latest available version is detected (15.0.4-canary.20).
  eslint-config-next: N/A
  react: 19.0.0-rc-380f5d67-20241113
  react-dom: 19.0.0-rc-380f5d67-20241113
  typescript: 5.3.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Developer Experience, Linting

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

No response

@asos-tomp asos-tomp added the bug Issue was opened via the bug report template. label Nov 20, 2024
@github-actions github-actions bot added Developer Experience Issues related to Next.js logs, Error overlay, etc. Linting Related to `next lint` or ESLint with Next.js. labels Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Developer Experience Issues related to Next.js logs, Error overlay, etc. Linting Related to `next lint` or ESLint with Next.js.
Projects
None yet
Development

No branches or pull requests

1 participant