You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/mcp-prompts/nextjs-16.md
+22-13Lines changed: 22 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Next.js 16 (cacheComponents Mode): The Complete AI Agent Guide
1
+
# Cache Components Mode: The Complete AI Agent Guide
2
2
3
3
## Authoritative Reference Based on E2E Test Suite Patterns
4
4
@@ -7,19 +7,21 @@
7
7
**Source**: Derived from 125+ E2E test fixtures and behavioral assertions
8
8
**Last Updated**: January 2025
9
9
10
+
**⚠️ SCOPE**: This guide covers Cache Components mode (`experimental.cacheComponents: true`). These rules do NOT apply to standard Next.js 16 without Cache Components enabled.
11
+
10
12
---
11
13
12
14
## 🎯 What AI Agents Get Wrong (And Why)
13
15
14
-
Based on analyzing the complete E2E test suite, AI agents consistently make these mistakes:
16
+
Based on analyzing the complete E2E test suite, AI agents consistently make these mistakes**when Cache Components is enabled**:
15
17
16
-
### ❌ **CRITICAL ERRORS AI AGENTS MAKE:**
18
+
### ❌ **CRITICAL ERRORS AI AGENTS MAKE (with cacheComponents enabled):**
17
19
18
20
1.**Using `loading.tsx` for loading states** (deprecated for PPR shell generation)
19
21
2.**Using `export const dynamic = 'force-static'`** (completely incompatible with cacheComponents)
3.**Using `export const fetchCache`** (raises build error with cacheComponents)
23
+
4.**Using `export const revalidate`** (raises build error with cacheComponents)
24
+
5.**Using `export const dynamicParams`** (raises build error with cacheComponents)
23
25
6.**Using `export const runtime`** (raises build error when incompatible with cacheComponents)
24
26
7.**Accessing `cookies()`/`headers()` in `'use cache'`** (throws runtime error)
25
27
8.**Using `'use cache: private'` without `<Suspense>`** (build error)
@@ -163,10 +165,12 @@ This is THE CORE DIFFERENCE that AI agents must understand.
163
165
164
166
**Test Source**: Multiple test files
165
167
166
-
#### Behavior 1: Segment Configs Are Forbidden
168
+
#### Behavior 1: Route Segment Configs Are Incompatible with Cache Components
169
+
170
+
**⚠️ NOTE**: These configs work fine in Next.js 16 WITHOUT cacheComponents. They're only forbidden when `experimental.cacheComponents: true` is enabled.
167
171
168
172
```typescript
169
-
// ❌ TEST SHOWS THIS ERRORS AT BUILD:
173
+
// ❌ BUILD ERROR (when cacheComponents is enabled):
Copy file name to clipboardExpand all lines: src/mcp-resources/nextjs-16-knowledge/00-overview.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Next.js 16 (cacheComponents Mode): The Complete AI Agent Guide
1
+
# Cache Components Mode: The Complete AI Agent Guide
2
2
3
3
## Authoritative Reference Based on E2E Test Suite Patterns
4
4
@@ -7,19 +7,21 @@
7
7
**Source**: Derived from 125+ E2E test fixtures and behavioral assertions
8
8
**Last Updated**: January 2025
9
9
10
+
**⚠️ SCOPE**: This guide covers Cache Components mode (`experimental.cacheComponents: true`). These rules do NOT apply to standard Next.js 16 without Cache Components enabled.
11
+
10
12
---
11
13
12
14
## 🎯 What AI Agents Get Wrong (And Why)
13
15
14
-
Based on analyzing the complete E2E test suite, AI agents consistently make these mistakes:
16
+
Based on analyzing the complete E2E test suite, AI agents consistently make these mistakes**when Cache Components is enabled**:
15
17
16
-
### ❌ **CRITICAL ERRORS AI AGENTS MAKE:**
18
+
### ❌ **CRITICAL ERRORS AI AGENTS MAKE (with cacheComponents enabled):**
17
19
18
20
1.**Using `loading.tsx` for loading states** (deprecated for PPR shell generation)
19
21
2.**Using `export const dynamic = 'force-static'`** (completely incompatible with cacheComponents)
Copy file name to clipboardExpand all lines: src/mcp-resources/nextjs-16-knowledge/01-core-mechanics.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,10 +53,12 @@ This is THE CORE DIFFERENCE that AI agents must understand.
53
53
54
54
**Test Source**: Multiple test files
55
55
56
-
#### Behavior 1: Segment Configs Are Forbidden
56
+
#### Behavior 1: Route Segment Configs Are Incompatible with Cache Components
57
+
58
+
**⚠️ NOTE**: These configs work fine in Next.js 16 WITHOUT cacheComponents. They're only forbidden when `experimental.cacheComponents: true` is enabled.
57
59
58
60
```typescript
59
-
// ❌ TEST SHOWS THIS ERRORS AT BUILD:
61
+
// ❌ BUILD ERROR (when cacheComponents is enabled):
0 commit comments