#Build error with `generateStaticParams`

4 messages · Page 1 of 1 (latest)

vagrant spear
#

I'm been a bit remiss and only tested a few small changes using my dev script:

"dev": "cross-env NODE_OPTIONS=--no-deprecation next dev --no-server-fast-refresh",

and now if I run my build script:

    "build": "next build",
    "postbuild": "next-sitemap --config next-sitemap.config.cjs",

I get the error below. I thought it was a missing env var so I've replaced all uses of that with a hard-coded value in all my collections and globals:

    admin: {
        hideAPIURL: true*,
    },

Any tips on how to narrow down the error will be appreciated.

next build

▲ Next.js 16.2.1 (Turbopack)

  • Environments: .env.local, .env

    Creating an optimized production build ...
    ✓ Compiled successfully in 9.1min
    ✓ Finished TypeScript in 61s
    Collecting page data using 7 workers ...Error: A required parameter (slug) was not provided as a string received object in generateStaticParams for /[slug]
    at ignore-listed frames

Build error occurred
Error: Failed to collect page data for /[slug]
at ignore-listed frames {
type: 'Error'
}
 ELIFECYCLE  Command failed with exit code 1.

vagrant spear
#

Build error with generateStaticParams

vagrant spear
#

Turns out it was a page without a slug, Don't know just how that jappened, but it's fixed:

DELETE FROM _pages_v WHERE parent_id IS NULL OR version_slug IS NULL;