What this thread does
The problem
Our recommendation: treat web and mobile upgrades separately. Patch web, then adopt caching and migrate native binaries as separate changes.
What changed
- Next.js 16.4.2 includes Turbopack fixes for Pages Router development module graph chaining and lazy dynamic-import chunk-list collisions. Patch release.
Versions and requirements
Our recommendation: consult the Expo compatibility tables before selecting native dependencies and toolchains.
| Target | Requirement |
|---|---|
| Next.js 16.4.2 | Release listed in the patch notes |
| Next.js SVG image optimization and Server Actions advisories | Patched versions: 16.4.1 and 15.5.28 |
What breaks
- The SVG advisory describes possible remote code execution in image optimization on glibc-based Linux. Its workaround is to ensure Next.js uses sharp 0.35.5 or later.
- The cache advisory concerns App Router applications with Cache Components and a
use cachefunction returning multiple typed arrays. - The Server Actions advisory describes excessive CPU usage from crafted requests against App Router applications with at least one Server Action.
When to pick which change
| Constraint | Recommendation |
|---|---|
| Security patch needed | Patch web; schedule caching adoption separately |
| App Router needs caching | Migrate one representative route; test streaming/prefetch |
| Native library blocks mobile | Patch web independently; resolve native compatibility |
| Shared UI | Verify each renderer and dependency resolution |
How to migrate
Our recommended sequence:
1. Inventory app versions, lockfile, routers, native ownership and patches. Record a production baseline. 2. Patch web first. Inspect the selected release and the resolved sharp version. The SVG advisory gives sharp 0.35.5 or later as a workaround for affected image optimization on glibc-based Linux. 3. Read the agent upgrade guide before choosing an upgrade command. Inspect the selected target. 4. Plan caching adoption as a separate App Router change; consult the Next.js release before choosing configuration or APIs. 5. Follow the Expo walkthrough to choose dependencies and commands. Our recommendation: upgrade one SDK at a time. 6. Review native project ownership before regenerating files. Consult the scene and Router guides before changing native lifecycle, web output, metadata or navigation tests; plan development and release builds.
What to test
Our recommended checks:
Check production builds, private-data isolation, Server Actions, SVG optimization on the production OS, direct loads, prefetch, refresh and back navigation. Inspect Expo web HTML before hydration, then interactivity. On mobile check cold launch, OAuth links, pushes, file read-after-write, resize and Android release behavior. Our recommendation: review build-mode configuration against the environment guide.
Pitfalls
The cache advisory has no known workaround for affected applications with such use cache functions and recommends upgrading immediately even without similar functions. The Server Actions advisory excludes Pages Router and apps without actions from that specific DoS. Our recommendation: assess exposure from the advisories and application configuration rather than an error string, and run release tests after Doctor. Our advice for stale Metro output: finish dependency alignment before investigating caches.
A prompt to give your agent
Read the linked releases, latest advisories, compatibility table and Router migration before editing. Do not guess versions, flags or errors. Separate patching, caching and native migration. Show resolved versions and native diffs, run production/device checks, and report exact failures and untested paths.
Limits
Our recommendation: read these additional sources before implementing release-specific changes: Next.js security announcement, Expo changelog, scene guide, cache error guide, Strict TypeScript API, Router migration, and File API.
Started from a post by @Next.js Team, packaged by the editor. Original post