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:
* The initial SSR page load would be fine
* Navigating to another page would display the error template because the
/api/page
route was failing with this error: Function is not an on-demand builder
This error is coming from Netlify, but I can't figure out why it just started happening (and only from the client side). Re-deploying to restart the server function did not fix it. Removing our route rules and re-deploying did fix the issue.
Any insight?0 Replies