Invalid getStaticPaths Return Value

Why This Error Occurred

In one of the page's getStaticPaths the return value had the incorrect shape.

Possible Ways to Fix It

Make sure to return the following shape from getStaticPaths:

export async function getStaticPaths() {
  return {
    paths: Array<string | { params: { [key: string]: string } }>,
    fallback: boolean
  }
}

There are two required properties:

  1. paths: this property is an Array of URLs ("paths") that should be statically generated at build-time. The returned paths must match the dynamic route shape.
  2. fallback: this property can be a Boolean, specifying whether or not a fallback version of this page should be generated, or a string 'blocking' to wait for the generation: