nx icon indicating copy to clipboard operation
nx copied to clipboard

Next app build failing due to eslint error - Plugin "react-hooks" was conflicted (Post update to 13.9.5 versions)

Open writam-roy opened this issue 2 years ago • 20 comments

Current Behavior

Whenver I run build of my next app it fails giving this error - Plugin "react-hooks" was conflicted between "apps\app-shell-ssr.eslintrc.json » eslint-config-next/core-web-vitals » C:\Sprint-8.6\idp-app-seed-ui-template\node_modules\eslint-config-next\index.js » plugin:react-hooks/recommended" and "apps\app-shell-ssr.eslintrc.json » ../../.eslintrc.json".

Expected Behavior

Next app builds should be fine after updating from 13.5.3 versions to 13.9.3(I used nx migrate)

Steps to Reproduce

here is my eslintrc.json { "extends": [ "plugin:@nrwl/nx/react-typescript", "../../.eslintrc.json", "next", "next/core-web-vitals" ], "ignorePatterns": [ "!/" ], "overrides": [ { "files": [ ".ts", ".tsx", ".js", ".jsx" ], "parserOptions": { "project": [ "apps/app-shell-ssr/tsconfig(.)?.json" ] }, "rules": { "@next/next/no-html-link-for-pages": ["error", "apps/app-shell-ssr/pages"] } }, { "files": [ ".ts", ".tsx" ], "rules": {} }, { "files": [ ".js", ".jsx" ], "rules": {} } ] } and lint config within project.json "lint": { "executor": "@nrwl/linter:eslint", "outputs": ["{options.outputFile}"], "options": { "lintFilePatterns": [ "apps/app-shell-ssr//*.{ts,tsx,js,jsx}" ] } },

Cannot share PR links,as it is for a private repo

This issue may not be prioritized if details are not provided to help us reproduce the issue.

Failure Logs

image

Environment

Node : 16.14.2 OS : win32 x64 yarn : 1.21.1

nx : 13.9.5 @nrwl/angular : Not Found @nrwl/cypress : 13.9.5 @nrwl/detox : Not Found @nrwl/devkit : 13.9.5 @nrwl/eslint-plugin-nx : 13.9.5 @nrwl/express : 13.9.5 @nrwl/jest : 13.9.5 @nrwl/js : 13.9.5 @nrwl/linter : 13.9.5 @nrwl/nest : 13.9.5 @nrwl/next : 13.9.5 @nrwl/node : 13.9.5 @nrwl/nx-cloud : Not Found @nrwl/nx-plugin : Not Found @nrwl/react : 13.9.5 @nrwl/react-native : Not Found @nrwl/schematics : Not Found @nrwl/storybook : 13.5.3 @nrwl/web : 13.9.5 @nrwl/workspace : 13.9.5 typescript : 4.3.5 rxjs : 6.6.7

writam-roy avatar Mar 30 '22 18:03 writam-roy

Its possibly unrelated, but it looks like storybook is a bit behind in your repo. Can you try running nx migrate @nrwl/[email protected]

AgentEnder avatar Mar 30 '22 18:03 AgentEnder

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏

github-actions[bot] avatar Apr 14 '22 00:04 github-actions[bot]

Any updates to this? I'm dealing with a similar issue:

error - ESLint: Plugin "@next/next" was conflicted between ".eslintrc.json » eslint-config-next/core-web-vitals » plugin:@next/next/core-web-vitals" and "../../../.eslintrc.json » eslint-config-next/core-web-vitals » plugin:@next/next/core-web-vitals".

vinicius5581 avatar Apr 18 '22 00:04 vinicius5581

I am having the same issues with an npx create-next-app@latest app

Vanals avatar Apr 29 '22 07:04 Vanals

ERROR in Plugin "react" was conflicted between "package.e_modules\eslint-config-react-app\base.js" and "BaseConft-app\base.js". how can i fix it??

g035653 avatar May 02 '22 19:05 g035653

@writam-roy Have you tried using the latest Nx and Nextjs?

You could also remove plugin:@nrwl/nx/react-typescript which should resolve the conflicts.

ndcunningham avatar May 06 '22 22:05 ndcunningham

I can reproduce it on latest NX 14 version

Node : 16.14.0 OS : MacOS BigSur 11.3.1 pnpm : 6.32.12

nx : 14.1.7 next: 12.1.5 All nrwl versions 14.1.7 with react app (no angular) react: 18.1.0 typescript: 4.5.5

@ndcunningham Removing plugin:@nrwl/nx/react-typescript from it didn't work for me.

amacavei14 avatar May 20 '22 13:05 amacavei14

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏

github-actions[bot] avatar Jun 04 '22 00:06 github-actions[bot]

I can reproduce on latest NX 14 version as well. Removing plugin:@nrwl/nx/react-typescript from it didn't work for me either.

Node: 16.14.2 OS: MacOS Monterey 12.3.1 yarn: 1.22.17

nx: 14.3.2 typescript: 4.7.2

@amacavei14 downgrading the following dependencies fixed it for me: "eslint-config-next": "12.1.6" -> "12.1.5" "eslint-plugin-react": "7.30.0" -> "7.29.4" "eslint-plugin-react-hooks": "4.5.0" -> "4.3.0"

jdecastroc avatar Jun 16 '22 02:06 jdecastroc

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏

github-actions[bot] avatar Jul 01 '22 00:07 github-actions[bot]

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏

github-actions[bot] avatar Jul 15 '22 00:07 github-actions[bot]

This is still an issue, so commenting to prevent automatic closure.

jamiter avatar Jul 15 '22 13:07 jamiter

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏

github-actions[bot] avatar Jul 31 '22 00:07 github-actions[bot]

I can reproduce on latest NX 14 version as well. Removing plugin:@nrwl/nx/react-typescript from it didn't work for me either.

Node: 16.14.2 OS: MacOS Monterey 12.3.1 yarn: 1.22.17

nx: 14.3.2 typescript: 4.7.2

@amacavei14 downgrading the following dependencies fixed it for me: "eslint-config-next": "12.1.6" -> "12.1.5" "eslint-plugin-react": "7.30.0" -> "7.29.4" "eslint-plugin-react-hooks": "4.5.0" -> "4.3.0"

This fixed my issue.

thecoleorton avatar Aug 04 '22 19:08 thecoleorton

I tried, but it could not solve that error :( If anyone knows any solutions, please reply to help me. Thanks a lot.

ThuVuThiBich avatar Aug 05 '22 08:08 ThuVuThiBich

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏

github-actions[bot] avatar Aug 20 '22 00:08 github-actions[bot]

This is still an issue, so commenting to prevent automatic closure.

TVermaas avatar Aug 23 '22 13:08 TVermaas

Any idea how can i solve that ?

error - ESLint: Plugin "@next/next" was conflicted between ".eslintrc.json" and ".eslintrc.json » eslint-config-next/core-web-vitals » plugin:@next/next/core-web-vitals".

yeasinjabed2 avatar Aug 31 '22 13:08 yeasinjabed2

This error often happens if you have a conflicting .eslintrc file up your directory tree.

Example

| - some-dir/.eslintrc <- conflicting config
| - some-dir/somepath/your-project/.eslintrc

Solutions

Choose one of the solutions below:

A. Resolve Conflict

Find the conflicting .eslintrc configuration file and resolve the conflict.

B. Make your .eslintrc a root config

File: .eslintrc.json

{
+ "root": true
  "extends": "next/core-web-vitals"
}

More info

HaNdTriX avatar Sep 06 '22 18:09 HaNdTriX

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏

github-actions[bot] avatar Sep 21 '22 00:09 github-actions[bot]

Still an issue not stale

webberwang avatar Sep 30 '22 19:09 webberwang

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏

github-actions[bot] avatar Oct 16 '22 00:10 github-actions[bot]

Same here.

williamisnotdefined avatar Dec 27 '22 20:12 williamisnotdefined

Same here

TVermaas avatar Dec 29 '22 11:12 TVermaas

Same to me here. I'm currently using eslint-config-next: 13.1.3

hyalen avatar Jan 22 '23 23:01 hyalen

Same here :(

I have only one .eslintrc.json

eyenalxai avatar Mar 13 '23 09:03 eyenalxai

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

github-actions[bot] avatar Apr 13 '23 00:04 github-actions[bot]