I am building a website with NextJS that takes some time to build. It has to create a big dictionary, so when I run next dev
it takes around 2 minutes to build.
The issue is, when I run next export
to get a static version of the website there is a timeout problem, because the build takes (as I said before), 2 minutes, whihc exceeds the 60 seconds limit pre-configured in next.
In the NEXT documentation: https://nextjs.org/docs/messages/static-page-generation-timeout it explains that you can increase the timeout limit, whose default is 60 seconds: "Increase the timeout by changing the staticPageGenerationTimeout configuration option (default 60 in seconds)."
However it does not specify WHERE you can set that configuration option. In next.config.json? in package.json?
I could not find this information anywhere, and my blind tries of putting this parameter in some of the files mentioned before did not work out at all. So, Does anybody know how to set the timeout of next export? Thank you in advance.
module.exports = (phase, { defaultConfig }) => { @type {import('next').NextConfig} const nextConfig = { staticPageGenerationTimeout: 2000 /* config options here */ } return nextConfig }
According to the documentation. But it doesn't work still – Mccarthy