Expo Router 58 Changed Your Web Deployment Contract
An Expo upgrade can pass its build and still change what your web host is expected to serve. In SDK 58, Expo Router’s server output renders HTML on every request; previously, that output prerendered HTML during export. Expo also stabilized server features and enabled async web routes by default. The practical decision is not simply whether to upgrade: it is whether your pages need a request-time server, prerendered HTML with API routes, or a genuinely static host. Expo’s November 30 Router update makes the distinction explicit. (expo.dev)
I would settle that deployment contract before changing application code. Then I would test the exported artifact, the raw HTML, and the behavior of an actual deployed preview—not just the development server.
Start with the output you intend to operate
Expo’s SDK 58 release notes say Router projects use server when web.output is unset. However, the general website publishing guide describes single as its fallback. Rather than depend on a default across project configurations or documentation contexts, set web.output explicitly and verify the resulting export. (expo.dev)
There are three useful choices:
static, without API routes: Generate HTML at build time and deploy the resulting files to a static host. This is a good fit for public pages whose content can wait for a rebuild.static, with API routes: Keep prerendered HTML but deploy a server for API routes. This is the migration path Expo recommends for the SDK 57serverbehavior.server: Render HTML for each request and deploy both the client assets and a compatible server runtime. Choose this when the HTML genuinely needs request-specific data.
There is also single, an SPA output with one HTML entry point. It is a different trade-off, not a substitute for per-route prerendered HTML. Static dynamic routes must be known at export time—for example, through generateStaticParams; request-time rendering handles dynamic routes differently. (docs.expo.dev)
A concrete example: a product documentation site with a small contact API may want static HTML plus API routes. An account page whose initial HTML depends on the current request may justify server rendering. In the first case, the API still needs a server; in the second, the page-rendering path needs one too.
Preserve prerendered pages with API routes
If you used web.output: "server" on SDK 57 and want the same broad deployment behavior, Expo recommends this SDK 58 configuration:
{
"expo": {
"web": { "output": "static" },
"plugins": [["expo-router", { "apiRoutes": true }]]
}
}
Merge these settings into your existing configuration rather than replacing other plugin options. With this combination, Expo exports prerendered HTML and API routes into dist/server and client assets into dist/client. Do not upload only dist/client and assume the pages and API will work. The server portion must also be deployed to a compatible runtime. (docs.expo.dev)
If you do not need API routes, leave them disabled for static output and deploy the static export instead. If you do need request-time HTML, set web.output to server and confirm that your host supports Expo Router server rendering. Expo documents Expo Hosting and adapters for several other runtimes; validate the adapter and infrastructure you actually use. (docs.expo.dev)
Check the HTML before JavaScript runs
For SDK 58 static rendering without React Server Components, metadata rendered through expo-router/head is no longer included in the initial static HTML. It can still update after hydration, but that is not equivalent for consumers that inspect the initial response. Move route-specific metadata that must be present immediately into generateMetadata(). (docs.expo.dev)
For example, in a route file:
import type { Metadata } from 'expo-router/server';
import { Text } from 'react-native';
export function generateMetadata(): Metadata {
return {
title: 'Documentation',
description: 'Product documentation and guides.',
};
}
export default function Page() {
return <Text>Documentation</Text>;
}
Metadata resolves from the matched route, not its layouts. If a layout supplied shared tags through Head, move them into route metadata or place genuinely shared tags in the root HTML component. For static rendering, generateMetadata does not receive a request; its second argument contains route parameters. (docs.expo.dev)
After exporting and deploying a preview, inspect the response source for representative routes. Check the title, description, canonical and social tags your site actually uses. This verifies delivery of the tags, not a search ranking outcome.
Also inspect any custom app/+html.tsx or src/app/+html.tsx. SDK 58 requires it to use useServerDocumentContext() and render the supplied document attributes and nodes. In particular, bodyNodes includes JavaScript bundles needed for hydration. A page can look correct as HTML while failing to become interactive if those nodes are omitted. Navigation hooks belong in the root layout rather than root HTML. (docs.expo.dev)
Revisit loader caching and server boundaries
Data loaders, server rendering, and middleware no longer require the old unstable_ configuration flags. Remove unstable_useServerRendering, unstable_useServerDataLoaders, and unstable_useServerMiddleware: even setting them to false no longer disables those features in SDK 58. Review the actual output mode and server behavior instead. (docs.expo.dev)
Loader caching also changed. SDK 58 uses the platform HTTP cache rather than Expo Router’s previous in-memory cache between route visits. Set and test Cache-Control deliberately. For personalized responses, a conservative starting point is private, no-store; for public data, choose a freshness window that matches the product. Verify the response headers and any CDN behavior rather than assuming the browser is the only cache. (expo.dev)
Static loaders run during the build and their results are embedded in exported HTML. That makes them appropriate for build-time public content, not per-user secrets or request-specific account data. Expo also notes that, in a static export, a loader’s cache header applies to both the data file and the HTML page embedding it. Audit those headers before making content publicly cacheable. (docs.expo.dev)
Test navigation as a deployment feature
Async routes are enabled by default on web in SDK 58, splitting route files into separate bundles. That changes what a user experiences when opening a route or navigating under poor network conditions. Expo also notes that async routes use the default loading fallback rather than a layout’s custom SuspenseFallback. If the custom fallback is important, the Router plugin can disable the default with asyncRoutes: { web: false }. Test the trade-off before opting out. (docs.expo.dev)
I would test a direct deep link, a refresh on that link, navigation to a not-yet-loaded route, and a failed or slow chunk request. Check your host’s routing and asset behavior in the deployed preview, not only locally.
A release checklist that catches the contract change
- Record the current SDK 57 output, hosting setup, API routes, and expected HTML behavior.
- Set the SDK 58 output explicitly; decide whether API routes require a runtime.
- Run
npx expo export --platform web, thennpx expo serveto exercise the exported build locally. Inspect the output directories for the selected mode. (docs.expo.dev) - Deploy a preview using the same runtime and routing configuration planned for production. Request public pages and API endpoints directly.
- Inspect raw HTML, hydration, loader headers, personalized responses, and deep-link behavior. Compare these checks with the previous release.
- Keep the previous deployment available and document how to restore it. A rollback should restore the matching client and server artifacts together.
FAQ
Does SDK 58 mean every Expo web app needs a server?
No. Static output without API routes can be deployed as static files. Server output requires a runtime, as does static output with Expo Router API routes enabled. (docs.expo.dev)
Can I keep prerendered HTML and API routes?
Yes. Set web.output to static and enable apiRoutes in the Expo Router plugin. Deploy the server output as well as the client assets. (docs.expo.dev)
Should I migrate every Head tag?
Prioritize metadata that must appear in the initial static HTML. Head can still update metadata after hydration, but for SDK 58 static rendering without React Server Components its tags are not included in that initial HTML. (docs.expo.dev)
What should I read next?
For the broader mobile release context, see Building a Production-Ready Mobile Product with Expo. If you are reviewing an upgrade across platforms, Before You Upgrade Expo, Test What Happens When iOS Interrupts Your App covers a different but complementary test surface.
See more engineering work
If you are interested in how I approach product and infrastructure decisions, browse the work.