Next.js Discord

Discord Forum

2 Errors thrown during "npm run build" but complies successfully

Answered
Horned oak gall posted this in #help-forum
Open in Discord
Avatar
Horned oak gallOP
Hey I noticed these 2 errors thrown despite the success compile and was curious how to get rid of them / if they are effecting the build at all despite the compile working.
Image
Answered by B33fb0n3
View full answer

9 Replies

Avatar
Horned oak gallOP
For the first error I had looked it up and people say to save the package.json before trying to run build but this does not get rid of the error on my end... Also it then gives a check mark on "Linting and checking validy of types" right below it so not sure if it matters?
Avatar
@Horned oak gall Hey I noticed these 2 errors thrown despite the success compile and was curious how to get rid of them / if they are effecting the build at all despite the compile working.
Avatar
it looks like the connection to somewhere can't be created. Maybe your database or something. Make sure your .env variables are set correctly and your server is available
Avatar
@B33fb0n3 it looks like the connection to somewhere can't be created. Maybe your database or something. Make sure your .env variables are set correctly and your server is available
Avatar
Horned oak gallOP
I don't have the applications running at the moment. Does it matter to have them enabled during builds or is it kind of a "double check" to make sure that it CAN connect to them?
Avatar
@Horned oak gall I don't have the applications running at the moment. Does it matter to have them enabled during builds or is it kind of a "double check" to make sure that it CAN connect to them?
Avatar
When there are static routes, nextjs tries to build them during build time. When the specific service isn’t then online the page generation might fail. Normally your production service runs 24/7
Avatar
@B33fb0n3 When there are static routes, nextjs tries to build them during build time. When the specific service isn’t then online the page generation might fail. Normally your production service runs 24/7
Avatar
Horned oak gallOP
Makes sense. My first time doing this with nextjs and I just have a stage env on my VM as a "practice for actual deploy"..was offline to save $ currently
Any ideas on the first error regarding the pathing difference on eslintrc.json?
Avatar
Horned oak gallOP
^Figured this out. Long story short a ~week ago I messed up moving my project and it created a duplicate .eslintrc.json file that was 1 folder outside of my nextjs app... So this file wasn't showing in my project at all but when trying to run build it was being picked up! Deleted the previously messed up copy and runs smooth now.
Avatar
Answer
Avatar