Next JS local build issue
Unanswered
Brown bear posted this in #help-forum
Brown bearOP
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 😅
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 😅
17 Replies
What are you doing with babel?
Cause it clearly says it has disabled SWC in favor of babel since the babel config file exists
Brown bearOP
Thanks for the reply. We are using it to use StyleComponents as recommended
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
{
"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
Hmm.. if it worked before it should probably work now. However vercel is porting styled components to SWC so you might wanna check that out:
https://nextjs.org/docs/architecture/nextjs-compiler#styled-components
https://nextjs.org/docs/architecture/nextjs-compiler#styled-components
Brown bearOP
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??
If you go to that link it doesnt compile ?
Brown bearOP
my bad, i was looking at locall 3000 🙈
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
Brown bearOP
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?
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?
1) you start your dev server (pnpm dev)
2) go to localhost:3000
3) see nothing and it doesnt log compilation in the console?
Brown bearOP
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!
THANKS!! ðŸ»