Next.js Discord

Discord Forum

Next/Babel error

Answered
.dric posted this in #help-forum
Open in Discord
Hello.

I keep getting this next/babel error from .eslintrc.json and I honestly don't know why. I've tried playing around with the file to fix the error.
#1. Changed the extends
#2. Put babel in the plugins object

NOTE: I'm using Vercel to host my website.

Here is the error I'm getting:

ESLint: Failed to load config "next/babel" to extend from. Referenced from: /vercel/path0/nexus/.eslintrc.json
   Collecting page data ...
   Generating static pages (0/33) ...
   Generating static pages (8/33) 
   Generating static pages (16/33) 
   Generating static pages (24/33) 

The website is still able to get deployed, but I want to fix this error so it doesn't randomly come up later in production.

Here is my .eslintrc.json file:
{
  "extends": ["next/core-web-vitals", "next/babel"],
  "plugins": ["@babel/plugin-proposal-do-expressions"],
  "rules": {
    "react/no-unescaped-entities": "off",
    "@next/next/no-page-custom-font": "off"
  }
}


If you can help me, that would be great. Thanks!
Answered by !=tgt
fix the eslint errors
View full answer

15 Replies

@!=tgt remove the `"next/babel"` entry from the `extends` array
okay, so after removing that I got this error:

⨯ ESLint: Failed to load plugin '@babel/plugin-proposal-do-expressions' declared in '.eslintrc.json': Cannot find module '@babel/eslint-plugin-plugin-proposal-do-expressions' Require stack: - /vercel/path0/nexus/__placeholder__.js
   Collecting page data ...
   Generating static pages (0/33) ...
   Generating static pages (8/33) 
   Generating static pages (16/33) 
   Generating static pages (24/33) 
@!=tgt now remove the entry from the plugins array
That made the file unable to compile in deployment
💀
@.dric That made the file unable to compile in deployment
{
  "extends": ["next/core-web-vitals"],
  "rules": {
    "react/no-unescaped-entities": "off",
    "@next/next/no-page-custom-font": "off"
  }
}

use that
that's what i have rn
@!=tgt
@.dric Click to see attachment
fix the eslint errors
Answer
:meow_stare:
@!=tgt fix the eslint errors
ahh it worked
after fixing the eslint errors
thank you 🙏
@.dric ahh it worked
mark my answer as solution