Error with Nuxt 3 server API routes with SWR caching on Netlify
We have a client site that's largely driven using data from Contentful. It's structured where we have server API routes that fetch the Contentful data. The site has been live on Netlify since June with no issues. To this point, we haven't configured any caching via route rules. But to try to get our Contentful API usage under control, we added SWR caching rules to our API routes:
We started with a TTL of 60 seconds. We deployed the change a couple days and everything seemed fine. But today the site began erroring:
Any insight?
We started with a TTL of 60 seconds. We deployed the change a couple days and everything seemed fine. But today the site began erroring:
- The initial SSR page load would be fine
- Navigating to another page would display the error template because the
/api/pageroute was failing with this error:Function is not an on-demand builder
Any insight?