Hi,
We have been happily using Netlify for years, hosting multiple sites with Next.js and leveraging ISR for rebuilding. This setup has worked flawlessly for the past 2.5 years, but it suddenly stopped functioning correctly on Monday, 29/7.
Affected sites
All our NextJS sites are equally affected, one example: goboat-website-germany
, running NextJS version 12.1.6
Issue description
By “not working,” I mean that the site does not incrementally update in the background.
Code snippets
This is our getStaticProps function:
export const getStaticProps: GetStaticProps = async (context) => {
const variables: GetResourceQueryVariables = {
key: getKey(context),
target: context.preview ? 'draft' : 'live',
siteId,
type: 'page',
};
// this fetches data from our content service
const data = await getWithRetries('getResource', variables);
const now = new Date().toISOString();
if (!data.resource) {
return {
notFound: true,
};
}
return {
props: {
data,
now,
},
revalidate: 60,
};
};
And our page component is something like this:
const Page: NextPage<PageProps> = (props) => {
const content = props?.data?.resource?.content ?? {};
// this console log allows us to see when the page was generated
console.log('Site last built:', props.now);
return (
<>
<DynamicModuleGenerator content={content} />
</>
);
};
Observations
Visiting Mieten Sie ein Boot in Berlin - GoBoat Germany, at the moment, we see the log:
Site last built: 2024-07-09T12:09:10.310Z
Changes made in our CMS are not reflected on the website, as it does not rebuild in the background as expected.
When we manually trigger a rebuild, getStaticProps
runs correctly, pulling in the latest content from the CMS and updating the timestamp.
Steps Taken
- Cleared cache and triggered rebuild
- Purged cache using an API call
- Checked logs of the ISR function (found nothing obvious, logs available for only the last 7 days)
The above steps were attempted on goboat-website-denmark
without success. As our editors frequently trigger rebuilds on that site, I felt goboat-website-germany
serves as a better example since it is mostly left alone.
Timeline
On Monday, 29/7, our editors noted that changes made in the CMS no longer appeared on the website, with all content reverting to a state from about 3 weeks prior (the time of our latest manually triggered deployment).
Suspicions
We did not make any changes to our websites, code, or configuration during this period, leading me to believe the issue lies with Netlify.
I have read about a new runtime rollout for Next.js. Since we are using a version lower than 13.5, I assumed it wouldn’t affect us, but perhaps it has?
Request for Assistance
Could anyone shed light on this issue or suggest further steps to diagnose and resolve it? Any insights would be greatly appreciated.
Thanks, Elias