Next.js Discord

Discord Forum

Restarted static page generation for / because it took more than 60 seconds

Unanswered
American black bear posted this in #help-forum
Open in Discord
Avatar
American black bearOP
I have this issue when I run npm run build.
If I remove all async calls from my page.tsx, it works fine... What am I doing wrong?
 ✓ Collecting page data    
 ⚠ Sending SIGTERM signal to static worker due to timeout of 60 seconds. Subsequent errors may be a result of the worker exiting.
 ⚠ Restarted static page generation for / because it took more than 60 seconds
 ⚠ See more info here https://nextjs.org/docs/messages/static-page-generation-timeout
 ⚠ Sending SIGTERM signal to static worker due to timeout of 60 seconds. Subsequent errors may be a result of the worker exiting.
 ⚠ Restarted static page generation for / because it took more than 60 seconds
   Generating static pages (21/22)  [=   ]

34 Replies

Avatar
@B33fb0n3 delete the .next folder and start it again. If it still doesnt work, make sure to provide some code so we can have a look into it. Maybe even providing a repro (github or codesandbox)
Avatar
American black bearOP
it’s just the homepage. I have a few requests inside of it and when I remove all requests it works
and I already deleted the .next folder
I also deleted the node_modules
Avatar
@American black bear and I already deleted the .next folder
Avatar
what's the result? Does it work?
If it still doesnt work, make sure to provide some code so we can have a look into it. Maybe even providing a repro (github or codesandbox)
Avatar
@B33fb0n3 what's the result? Does it work?
Avatar
American black bearOP
no
Avatar
American Crocodile
Dumb questions, have you tried to increase to timeout to a long time to see if it works? staticPageGenerationTimeout
there are two comments with the paths
If I remove the fetchWinners function it works fine
Avatar
@American black bear https://pastebin.com/t31mmV1u
Avatar
is your src/app/(home)/components/_Header/Header.tsx a client component as you access as context provider useTranslation(lang, 'navbar')?
I am using useTranslation also for server components
like I said, everything works if I remove the fetchWinners function
Avatar
do you get the correct translations? 🤔
Avatar
@B33fb0n3 do you get the correct translations? 🤔
Avatar
American black bearOP
yup
there's the use prefix but it's not really a hook
Avatar
ah ok... can you add some loggings to the getWinners to see if it will be called, to see when you get the result and what's the result and also make sure to stop the time between the callings.

TL;DR
So log:
1. if it will be called
2. when you get a result
3. what's the result
4. The execution time of the fetch
I deleted and added it line by line until it worked
on the last line the git changes went from 1 to 0 and the build went through
I didn't understand anything but we can't question everything xD
Avatar
@B33fb0n3 haha ok, can you clarify?
Avatar
American black bearOP
I deleted the home folder and added the old one back. the build passed
then I started adding my code line by line until everything was the same
and suddendly it worked 🙂
which does not make any sense because I published the code and a friend tried on their side and the error was the same
Avatar
I am quite confused. Is your error now solved or do you still need a solution?
it's good now
Avatar
haha alright 🤣