Invalid route segment config

next/segment-configerror / warningnextjs-16correctnessperformance

Why it matters

Next.js reads dynamic, revalidate, runtime, fetchCache, dynamicParams, preferredRegion and maxDuration statically from page/layout/route files and only accepts literal values from a fixed set; with cacheComponents enabled, dynamic/revalidate/fetchCache are rejected.

Fix

Use one of the allowed literal values, or switch to "use cache" with cacheComponents.

Credit

  • From the Next.js team

    Route segment config options are read statically and only accept literal values; Cache Components replaces dynamic, revalidate and fetchCache with 'use cache'.

References

See it