#Next JS local build issue

20 messages · Page 1 of 1 (latest)

meager breach
#

I am facing a very weird issue that I cannot build the app locally. I first had this on the weekend but restarting my laptop fixed it after trying a few other things.

Whats worrying is its happened again and restart wont fix it. Also my team mate had this issue today.

So far I have tried:

  • delete nod_mods, prune pnpm store, delete pnpm-lock, reinstall (repeat after most steps below)
  • update pnpm to latest
  • check pnpm Storybook works, it does
  • update Next JS to latest
  • get latest env var files
  • disable nginx on launch so port 3000 is always free
  • updated dated to latest mac OS
  • no build errors when i run pnpm build

You can see there is no error, it just sticks at this step, any suggestions are welcome at this point, has anyone else faced this issue?

Please help 😅

acoustic shuttleBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

drowsy tendon
#

What are you doing with babel?

#

Cause it clearly says it has disabled SWC in favor of babel since the babel config file exists

meager breach
#

Thanks for the reply. We are using it to use StyleComponents as recommended

{
  "presets": ["next/babel"],
  "plugins": [
    [
      "styled-components",
      { "ssr": true, "displayName": true, "preprocess": false }
    ]
  ]
}

we are refactoring this dependancy away but its never caused this build issue before, nor for anyone else in the team. Thanks for the quick responce

drowsy tendon
meager breach
#

cool thanks for the share but we are moving away from Styled, too much BS with SSR. Any suggestions of anything I can try?

#

i face the same issue with a clean install... what the heck??

#

Next JS clean install wont build with pnpm

drowsy tendon
#

If you go to that link it doesnt compile ?

meager breach
#

Next JS local build issue

#

my bad, i was looking at locall 3000 🙈

drowsy tendon
#

You need to actually open a route for that route to compiled(server and client side). Thats because you are using development server and not building your app

meager breach
#

i never know how best to describe it, its the dev env and i know its not part of the build command... should i say the local dev env is not completeing?

drowsy tendon
#

Ok so what you are trying to say is that

  1. you start your dev server (pnpm dev)

  2. go to localhost:3000

  3. see nothing and it doesnt log compilation in the console?

meager breach
#

yeah I was seeing a loading favIcon that never went away

#

BUT

#

now, i dont know what changed but for the first time it works

#

well ive literally changed very part of the stack but for some reson this time it worked

#

thanks for offering some help, i appreciate you!