Next.js 16 + Tailwind v4: 5 traps AI coding assistants keep hitting (and the prompts that fix them) A developer documented five recurring failure modes that AI coding assistants hit when scaffolding apps with Next.js 16.4.2 and Tailwind CSS v4, including build failures from the new default `cacheComponents` and `partialPrefetching` config options that reject the older `export const dynamic = "force-dynamic"` pattern and prerender `new Date()` calls. The writeup pairs each symptom with the exact error text, the reason assistants trained on Next 13–15 and Tailwind v3 get it wrong, a fix, and a paste-ready prompt for tools like Cursor, Claude Code, and ChatGPT. A fresh create-next-app in late 2026 gives you Next.js 16 and Tailwind CSS v4. Most AI coding assistants learned on years of Next 13–15 and Tailwind v3 code. That gap produces the same handful of failures again and again, and they often show up only at npm run build , or only on a laptop set to dark mode. Below are five of them. For each one you get the symptom with the exact error text where there is one , why the assistant gets it wrong, the fix, and a short prompt you can paste into Cursor, Claude Code, or ChatGPT. Versions used: create-next-app 16.4.2 Next.js 16.4.2, React 19.3 , Tailwind CSS 4.3, Node 20. npm run build fails on a brand-new app cacheComponents Symptom. npm run dev looks fine, then the build fails with one of these: Route segment config "dynamic" is not compatible with nextConfig.cacheComponents . Please remove it. Route "/expenses": Next.js encountered the unstable value new Date in a Client Component. This value would be evaluated during the prerender, instead of recomputed on each visit. Why the assistant gets it wrong. With its recommended defaults --yes , create-next-app 16.4 now writes this into next.config.ts : js const nextConfig: NextConfig = { cacheComponents: true, partialPrefetching: true, turbopack: { / … Tailwind CSS loader … / }, }; The Next.js caching docs say it directly: new App Router apps made with the recommended defaults "already have Cache Components and Partial Prefetching enabled." The assistant doesn't know this. It reaches for the Next 13–15 habit of export const dynamic = "force-dynamic" , which Cache Components rejects, or it puts new Date in a component that now gets prerendered. In our test runs, both of our sample apps failed npm run build at this point. One failed on the dynamic export and one on a new Date default for a date input. The fix that worked was removing the two config lines. Fix, option A: opt out fine for a localStorage app or a small landing page : js // next.config.ts const nextConfig: NextConfig = { // removed: cacheComponents: true, // removed: partialPrefetching: true, turbopack: { / keep this block: it loads Tailwind / }, }; You can also scaffold without it. In our check, the 16.4.2 CLI accepted --no-cache-components even though --help doesn't list it: npx create-next-app@latest my-app --ts --tailwind --eslint --app --use-npm --yes --no-cache-components After either change, delete .next/ and rebuild. Fix, option B: keep Cache Components and do it its way. Remove the dynamic export. The migration guide says to drop force-dynamic , because uncached work already runs at request time. Then put the request-time part behind