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
@@ -663,6 +668,11 @@ These options will cause build errors and MUST be migrated:
663
668
-`revalidate: 3600` → Use `cacheLife({ revalidate: 3600 })`
664
669
-`fetchCache: 'force-cache'` → Use `"use cache"`
665
670
671
+
**Important:** When removing `export const dynamic`, replace it with a comment documenting the original static/dynamic mode:
672
+
-`export const dynamic = 'force-static'` → Replace with: `// MIGRATED: Was force-static mode - now using "use cache"`
673
+
-`export const dynamic = 'force-dynamic'` → Replace with: `// MIGRATED: Was force-dynamic mode - now using <Suspense>`
674
+
- This preserves the original mode information for later verification
675
+
666
676
Document all Route Segment Config locations now - you'll migrate them in Phase 5.
667
677
668
678
**Step 6: Verify configuration changes**
@@ -679,10 +689,12 @@ After making changes, verify by reading the config file:
679
689
**What's Next:**
680
690
With configuration updated, Phase 3 will start the dev server and Phase 4 will detect any runtime errors that need fixing.
681
691
682
-
## PHASE 3: Start Dev Server with MCP
692
+
## PHASE 3: Start Dev Server with MCP (Optional)
683
693
────────────────────────────────────────
684
694
685
-
**IMPORTANT: Only start the dev server ONCE. Do NOT restart it during this process.**
695
+
**IMPORTANT: This phase is optional.** You can skip directly to Phase 5 (build-first approach) if you prefer to identify all errors upfront from the build output.
696
+
697
+
**If using Phase 3/Phase 4 workflow:** Only start the dev server ONCE. Do NOT restart it during this process.
686
698
687
699
### Step 1: Start Dev Server (ONE TIME ONLY)
688
700
@@ -962,10 +974,38 @@ Systematically verify each route and collect errors:
962
974
────────────────────────────────────────
963
975
964
976
**Prerequisites:**
965
-
- ✅ Dev server is still running from Phase 3 (do NOT restart it)
966
977
- ✅ Comprehensive error list collected from Phase 4
967
978
- ✅ Fast Refresh will apply changes automatically (no restart needed)
968
979
980
+
**NEW STRATEGY: Build-First Approach**
981
+
982
+
This phase uses an optimized two-step verification strategy:
983
+
984
+
**Step 1: Run Full Build to Identify All Failing Routes**
985
+
```bash
986
+
<pkg-manager> run build
987
+
```
988
+
989
+
This build identifies all routes with Cache Components errors at once, giving you a comprehensive view of what needs to be fixed:
990
+
- Build output shows all failing routes
991
+
- Error messages are explicit and clear
992
+
- All missing Suspense boundaries/cache directives are identified
993
+
- Stack traces point to exact locations needing fixes
994
+
995
+
**Step 2: Use Dev Server for Interactive Verification & Fixing**
996
+
```bash
997
+
# Dev server may already be running from Phase 3
998
+
# If not, start it:
999
+
__NEXT_EXPERIMENTAL_MCP_SERVER=true <pkg-manager> dev
1000
+
```
1001
+
1002
+
For each failing route:
1003
+
1.**If error is explicit from build logs:** Fix directly based on the error message
1004
+
2.**If error needs verification:** Start dev server, test the route, and fix interactively with Fast Refresh
1005
+
3.**Re-verify:** After fixing, either:
1006
+
- Run build again to check that route
1007
+
- Test in dev to verify with Fast Refresh
1008
+
969
1009
**⚠️ MANDATORY: Load error-specific resources BEFORE fixing any errors**
970
1010
971
1011
You MUST load these resources to fix errors correctly:
@@ -1032,7 +1072,11 @@ For detailed code examples and patterns for each error type, refer to the knowle
1032
1072
- B. Dynamic values → Use connection() or extract to separate component
1033
1073
- C. Route params → Add generateStaticParams
1034
1074
- D. Unavailable APIs in cache → Move outside cache scope or use "use cache: private"
1035
-
- E. Route Segment Config → Migrate to "use cache" + cacheLife
1075
+
- E. Route Segment Config → Migrate to "use cache" + cacheLife with documentation
1076
+
-**When removing `export const dynamic`:** Replace with a comment documenting the original mode for later verification
1077
+
- Example: If removing `export const dynamic = 'force-static'`, add comment: `// MIGRATED: Was force-static mode - now using "use cache"`
1078
+
- Example: If removing `export const dynamic = 'force-dynamic'`, add comment: `// MIGRATED: Was force-dynamic mode - now using <Suspense>`
1079
+
- This helps track what the original static/dynamic mode was for verification purposes
1036
1080
- F. Caching strategies → Configure cacheLife() and cacheTag()
1037
1081
1038
1082
**After Each Fix:**
@@ -1068,14 +1112,72 @@ For detailed code examples and patterns for each error type, refer to the knowle
1068
1112
- ✅ Content displays correctly
1069
1113
- ✅ Performance is acceptable
1070
1114
1115
+
**Handling Unclear Cases That Can't Be Resolved:**
1116
+
1117
+
If after multiple attempts a fix continues to fail or the issue is unclear, leave a comment documenting the problem:
1118
+
1119
+
```typescript
1120
+
// ⚠️ UNRESOLVED: Unable to determine caching strategy for this component
0 commit comments