All imports must resolve in next.config
when running next lint
. This prevents monorepos from linting before building dependent packages.
#73012
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.
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 afile:
resolution inpackage.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
The text was updated successfully, but these errors were encountered: