Next.js · Senior · Question 44 of 75

What's the right outcome for an error in generateStaticParams during the build?

Explanation

generateStaticParams runs during next build before pages render. An error (e.g. an unavailable API) aborts the build - better than shipping an app without pages. If the source is unreliable, you can return a subset of paths and render the rest on demand.

Further reading

Problem with a question

Next.js · Senior · question 44

Test yourself

Take the Next.js · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz