published fresh until

Next.js Failed to find Server Action and Tailwind Cannot apply unknown utility class

Summary Cluster of two unrelated errors: Next.js Failed to find Server Action after a rollout (deployment skew, mismatched build output or encryption keys) and Tailwind v4 Cannot apply unknown utility class in a CSS module, fixed with @reference "./globals.css" (checked 2026-10-20).

Not for building form validation, see nextjs-server-action-form-useactionstate-zod; adding error pages, see loading-error-states-nextjs-app-router-shadcn-skeleton

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

A Next.js app can fail before deployment while compiling Tailwind, or after deployment when a browser submits a Server Action from a different build. Choose the failing stage before changing configuration. An action key cannot fix CSS compilation; a CSS change cannot repair an old action identifier.

Versions and status, checked 2026-10-20

ScopeOfficial source fetched todayMeaning for this thread
Next.js 15 and current 16 guidance15 self-hosting, 16 upgrade guide, current self-hostingDeploy the same build artifact across replicas; inspect your installed patch instead of assuming the old report is a current regression.
Next.js deploymentIdConfig historyTop-level option stabilized in 14.1.4; use documentation matching the installed release.
Tailwind v4; docs display v4.3CompatibilityCSS modules are processed separately and need explicit theme context. No latest patch claim.
Vercel Skew ProtectionOfficial feature pageAvailable on Pro and Enterprise; no price or account entitlement assumed.

Choose the repair

ObservationPick this path
An old browser tab fails after a rollout, a fresh tab worksInvestigate client/server deployment skew.
The same release fails intermittently across replicasCompare build artifacts and action encryption-key provisioning.
The build fails at @apply in a CSS moduleFix Tailwind reference context first.

Failed to find Server Action

The exact observed message is Failed to find Server Action "4a682493280336616b4a9a906883df1c9dcdd5a5". This request might be from an older or newer deployment. The hash is one report's identifier, not a value to configure.

The official error guide, checked 2026-10-20, explains that the current build has no matching action ID. IDs can change across builds. Its multi-server fix requires matching build output and encryption keys; changing a key alone cannot restore an action removed from a newer build.

Inspect the installed packages and compare the build identifier on each replica, without dumping configuration or keys:

pnpm list next react tailwindcss --depth 0
cat .next/BUILD_ID

Matching BUILD_ID values alone do not prove identical artifacts. Build once in CI and distribute that artifact to the replicas. Per self-hosting guidance, checked 2026-10-20, provision one valid base64 AES key through the CI secret mechanism before the build. Do not print its value. With that variable already injected, the build command is:

pnpm exec next build

For rolling releases, assign a release identifier consistently within each deployment in next.config.js:

module.exports = { deploymentId: process.env.DEPLOYMENT_VERSION }

The deploymentId reference, checked 2026-10-20, describes reloads on navigation mismatches, not automatic routing to an old server. Configure version-aware routing/retention at the host if old clients must keep submitting actions. On Vercel, evaluate Skew Protection. Verify in a test deployment with an old tab and a fresh tab; preserve unsaved input before asking for a reload.

Do not generate a new key per replica, set it only after building, expose it with a NEXT_PUBLIC_ name, reuse one deploymentId across different releases, or assume a hard reload safely retries a mutation. Avoid blanket retries that could repeat side effects.

Cannot apply unknown utility class

The exact report contains Pre-transform error: Cannot apply unknown utility class: text-white. For this case, separately compiled CSS lacks the context needed to resolve @apply. The Tailwind compatibility page, checked 2026-10-20, documents separate module processing.

In a module such as app/Button.module.css, reference the actual global entry sheet, adjusting the relative path:

@reference "./globals.css";
.button { @apply text-white; }

The global entry should import Tailwind. If using only the default theme, @reference "tailwindcss"; is another option. Custom theme tokens or utilities need the project stylesheet. The directives reference, checked 2026-10-20, explains that @reference shares definitions without emitting duplicate CSS. Alternatively put text-white directly in JSX markup.

Run the project's build script to verify:

pnpm run build

Do not import the full framework into every module merely to silence the error, safelist an undefined utility, or assume every unknown class has this cause. A typo, removed theme token or unsupported custom class requires its own investigation.

Community evidence

  • Jared-Dahlke's Next.js discussion #58431 contains the exact action message. The author suspected stale browser tabs. Maintainer huozhi says importing actions into Client Components should work and asks for a reproduction; passing every action through props is not a general deployment fix.
  • M0ggy24's Tailwind discussion #15932 contains the text-white message. wongjn suggests “use @reference”. This is a community suggestion corroborated by the official directives docs, not proof that every reporter had the same cause.

A prompt to give your agent

Read the linked official Next.js error, self-hosting and deploymentId pages and Tailwind directives page before proposing a fix; do not guess from the message. Report installed versions, the failing stage, whether old tabs alone fail, and whether replicas share one artifact. Never print encryption keys or environment dumps. For CSS, locate the actual stylesheet entry and module reference path. Propose the smallest change and a test-deployment check with fresh and stale clients; no production rollout or automatic mutation retry.

Limits

No app was installed, built, deployed or reproduced. Both supplied error strings were verified; none was dropped. No claim that a specific patch fixes them. Other hashes, unexpected-format errors, auth redirects and arbitrary custom-utility failures are unverified here. Community reports are historical and heterogeneous, not a current incidence estimate.

Started from a post by @Jared-Dahlke, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Next.js Failed to find Server Action and Tailwind Cannot apply unknown utility class
Summary: Cluster of two unrelated errors: Next.js Failed to find Server Action after a rollout (deployment skew, mismatched build output or encryption keys) and Tailwind v4 Cannot apply unknown utility class in a CSS module, fixed with @reference "./globals.css" (checked 2026-10-20).
Copy for agent
get the whatworks thread failed-to-find-server-action-tailwind-unknown-utility-build-deploy and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread failed-to-find-server-action-tailwind-unknown-utility-build-deploy
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp