nextjs-16-server-action-requirements

Analyze Next.js 16 server actions for async exports and dynamic imports of next/headers.

1|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/Hankanman/claude-config --skill nextjs-16-server-action-requirements
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-16-server-action-requirements
Source: https://github.com/Hankanman/claude-config/tree/main/config/skills/nextjs-16-server-action-requirements
Command: npx skills add https://github.com/Hankanman/claude-config --skill nextjs-16-server-action-requirements

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill codifies the strict server-action requirements for Next.js 16 to prevent common build-time failures and misconfigurations in projects that use the "use server" directive.

Core Features & Use Cases

  • Async exports enforcement: All exported functions in server-action files must be async.
  • Import pattern guidance: Use dynamic imports for next/headers to avoid forced dynamic rendering.
  • Migration support: Provides a practical checklist to migrate code from Next.js 15 to 16 server actions without errors.

Quick Start

Use this skill to verify and adjust your Next.js 16 server-action files to comply with the rules.

Frequently Asked Questions about nextjs-16-server-action-requirements

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why do my Next.js 16 server actions fail to build when exporting non-async functions?

Next.js 16 server actions fail to build because all exported functions in server-action files must be async. You must enforce async exports and await all helper calls to prevent these build errors.

How do I prevent static imports of next/headers from forcing dynamic rendering in Next.js 16?

To prevent forced dynamic rendering in Next.js 16, use dynamic imports for next/headers instead of static imports. This import pattern guidance ensures your server actions remain compliant.

Can I export constants or types from a Next.js 16 server action file?

No, you cannot export constants or types from Next.js 16 server action files. The strict requirements prohibit exporting non-async values, constants, or enums to prevent build-time failures.

How do I migrate server actions from Next.js 15 to 16 without build errors?

To migrate server actions from Next.js 15 to 16, apply the migration checklist: enforce async exports, prohibit exporting constants, use dynamic imports for next/headers, and await all helper calls.

What are the Next.js 16 server-action requirements for awaiting helper calls?

Next.js 16 server-action requirements mandate awaiting all helper calls. Failing to await helper calls in server action files violates the async export enforcement and causes build-time failures.