strapi / strapi-starter-next-blog

Strapi Starter Next Blog
https://strapi-starter-next-blog-pearl.vercel.app/
MIT License
383 stars 145 forks source link

Please change to fallback: "blocking", or document why ISR does not work #46

Open reebalazs opened 3 years ago

reebalazs commented 3 years ago

This caused me a lot of time to figure out. I assumed that ISR would be working out of the box with this example. However when I created a new article on a Vercel deployment, I got the following error:

ERROR   Error: Cannot find module '/var/task/frontend/.next/server/pages/article/[slug].js'

This happened when an article was added on the fly. Static regeneration fixed the problem, which indicated that this is a problem with serverless generation only.

I spent a lot of time trying to figure out what might cause this error, with no result... I did not assume that Incremental Static Regeneration does not work on the vanilla starter template. Clearly, I am just starting to explore nextjs, which is why this was hard to figure out - but people who try the starter are expected to be beginners, too.

My suggestion is: either change the code to fallback: "blocking". Or if there is any reason not to do this, please document clearly that "if you want to enable ISR in Next, you have to do these manual changes".

The fallback: "blocking" would be desirable in both the article and the category slug, for completeness.