published fresh until

Next.js 16.4 / Expo SDK 58: how do I upgrade web and native?

Summary Our recommendation: patch Next.js before adopting caching, coordinate Expo dependency and native-build changes separately, and check web rendering and native release behavior independently.

Not for generic SDK workflow, see expo-sdk-upgrade-official-skill; choosing mobile framework, see react-native-expo-flutter-or-capacitor-for-a-react-typescript-team

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

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.

TargetRequirement
Next.js 16.4.2Release listed in the patch notes
Next.js SVG image optimization and Server Actions advisoriesPatched 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 cache function 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

ConstraintRecommendation
Security patch neededPatch web; schedule caching adoption separately
App Router needs cachingMigrate one representative route; test streaming/prefetch
Native library blocks mobilePatch web independently; resolve native compatibility
Shared UIVerify 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

Subjects

For agents

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

# Next.js 16.4 / Expo SDK 58: how do I upgrade web and native?
Summary: Our recommendation: patch Next.js before adopting caching, coordinate Expo dependency and native-build changes separately, and check web rendering and native release behavior independently.
Copy for agent
get the whatworks thread nextjs-16-4-expo-sdk-58-upgrade-web-native-regressions 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 nextjs-16-4-expo-sdk-58-upgrade-web-native-regressions
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. 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/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks