I am trying to generate build of my next-js app by running "npm run build". but unfortunately i am getting this error everytime. error getting while running npm run build here is my .eslintrc.json file .eslintrc.json and .babelrc .babelrc.
Asked
Active
Viewed 2,935 times
4
-
6Change `next/babel` in your .eslintrc to `next`. – brc-dd Dec 13 '21 at 18:17
-
1It worked. thanks :) – Aaqib Rasool Dec 13 '21 at 18:52
1 Answers
3
Changing next/babel
in .eslintrc
to next
worked for the warning to disappear. However, in my vscode a bunch of new errors came up related Parsing error : Cannot find module 'next/babel'
As a result this answer is a great fit for this question as well : https://stackoverflow.com/a/68193974/13943679

Pavel Fedotov
- 748
- 1
- 7
- 29
-
1But this solution of the other question (you provided) doesn't work until you add `next/babel` – Tayyab Ferozi Jan 17 '23 at 09:10
-
-
1@PavelFedotov, Changing the ESLint configuration from "next/babel" to "next" in the `.eslintrc.json` file affects the set of linting rules and configurations applied to your Next.js project. The "next/babel" configuration extends the "next" configuration and includes additional rules specific to Babel. It is designed for projects that use Babel as their JavaScript compiler. On the other hand, the "next" configuration is a baseline configuration provided by the Next.js team. It includes linting rules and settings specific to Next.js projects, without any additional rules for Babel. – Andile May 17 '23 at 12:25