Open jimisaacs opened 3 years ago
Tried to quickly reproduce and couldn't unfortunately 😞.
Is next
installed in client/package.json
or in the root folder? Are you also seeing the same errors when running next lint
?
installed in client/package.json
and client
is a yarn workspace. Yes, same result with next lint
.
cd client
yarn next lint
Thanks for the clarification @jimisaacs. Unfortunately I can't seem to reproduce this issue, but could you try adding the following to your .eslintrc
:
parserOptions: {
project: "tsconfig.json",
tsconfigRootDir: __dirname,
sourceType: "module",
}
It sounds like ESLint is running for you on a separate directory than where tsconfig.json
is located, so hopefully this fixes things.
@housseindjirdeh I have the same issue in a fully reproduced use case (glad to CI) : https://github.com/thisismydesign/nestjs-starter/pull/23
I fixed this with the eslint dirs
option:
src/client/next.config.js
module.exports = {
eslint: {
dirs: ['src/client'],
},
};
After this, next build
works.
I'm using it here: https://github.com/thisismydesign/nestjs-starter > https://github.com/thisismydesign/nestjs-starter/pull/83
I fixed this with the
eslint dirs
option:
src/client/next.config.js
module.exports = { eslint: { dirs: ['src/client'], }, };
After this,
next build
works.I'm using it here: https://github.com/thisismydesign/nestjs-starter > thisismydesign/nestjs-starter#83
2024 and still solved the issue 👍
What version of Next.js are you using?
11.0.0
What version of Node.js are you using?
v14.15.5
What browser are you using?
Chrome
What operating system are you using?
macOS
How are you deploying your application?
next export
Describe the Bug
when I run
next build
, it asked to installeslint-config-next
. So I did to try the new feature.after that I got numerous errors, seems like one for every page that look like this:
Yes, notice the
client/client
, that looks like the bug.my git project structure is this:
Expected Behavior
These errors should not happen. I also have my own eslint set up in the root of the repo, but I want to see what this feature offers before disabling it.
To Reproduce
Try to setup a project like what I've described, and run
next build
from theclient
directory.