How to Fix: Should not remove “apple-mobile-web-app-capable” Request a rollback #70272
Next.js should not remove apple-mobile-web-app-capable: how to roll back the behavior and preserve iOS standalone mode
The regression is simple but high impact: after the change referenced in issue #70272, projects that still rely on the legacy apple-mobile-web-app-capable meta tag can lose expected iOS web app behavior. If your app used that tag to enable standalone launch on iPhone or iPad, removing or auto-normalizing it can break install-like experiences, splash behavior expectations, and compatibility with older Apple-specific workflows.
What broke
In affected setups, Next.js metadata handling may remove, replace, or discourage use of apple-mobile-web-app-capable in favor of newer metadata APIs or standards-based fields. The problem is that real production apps may still depend on this exact tag for Safari and home-screen launch behavior on Apple devices.
The expected outcome is not theoretical purity. It is backward compatibility. If an application explicitly sets <meta name="apple-mobile-web-app-capable" content="yes" />, the framework should not silently strip it unless there is a guaranteed equivalent for every supported target.
Understanding the Root Cause
This happens because Next.js metadata generation tries to centralize and normalize head tags. During that process, framework logic may treat some legacy Apple meta tags as deprecated, duplicated, or replaceable by newer metadata fields such as web app manifest settings or higher-level metadata config.
The technical issue is that apple-mobile-web-app-capable is not just cosmetic. Historically, iOS Safari used it to determine whether a site launched from the home screen should open in standalone mode instead of the normal browser chrome. Even when newer mechanisms exist, many apps still include this meta tag because:
- They support a range of iOS versions.
- They need predictable behavior in home-screen launches.
- They migrated incrementally and still depend on legacy Apple-specific metadata.
- They cannot risk behavioral regressions in PWA-like flows.
If framework internals strip the tag during render, hydration, or metadata serialization, the app loses an explicit browser hint that some environments still honor. That is why a rollback request is reasonable: the framework should prefer non-destructive compatibility over aggressive cleanup.
Step-by-Step Solution
The safest resolution is to restore explicit output of the tag and avoid relying on framework behavior that removes it.
1. Add the legacy Apple meta tag explicitly
If you are using the App Router and metadata APIs are not preserving the tag, inject it manually in your layout head output.
export default function RootLayout({ children }) {
return (
<html lang="en">
<head>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
</head>
<body>{children}</body>
</html>
)
}
2. If using the Pages Router, add it in _document.js or _app.js
import { Html, Head, Main, NextScript } from 'next/document'
export default function Document() {
return (
<Html>
<Head>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
)
}
3. Avoid assuming manifest settings fully replace Apple-specific tags
Keep your manifest, but do not treat it as a guaranteed replacement for Safari-specific behavior.
{
"name": "My App",
"short_name": "MyApp",
"display": "standalone",
"start_url": "/",
"background_color": "#ffffff",
"theme_color": "#000000"
}
The manifest is still important, but Apple Safari compatibility has historically required extra meta tags.
4. If the metadata API is rewriting head tags, move the tag lower-level
Some framework abstractions may deduplicate or sanitize metadata. If that is happening, place the meta tag in the lowest-level rendering path you control, then verify the final server-rendered HTML.
curl -s http://localhost:3000 | grep apple-mobile-web-app-capable
If no output appears, the tag is still being removed somewhere in the render pipeline.
5. Patch or pin Next.js until the regression is fixed upstream
If the current release removes the tag no matter where you define it, use one of these mitigation options:
- Pin to the last known working Next.js version.
- Use patch-package to override the offending metadata behavior.
- Track the upstream discussion in the GitHub issue and remove the workaround after an official fix lands.
npm install next@<last-known-good-version>
Or with patch-package:
npm install patch-package postinstall-postinstall --save-dev
{
"scripts": {
"postinstall": "patch-package"
}
}
Then patch the internal metadata filtering logic so it does not remove apple-mobile-web-app-capable.
6. Verify on real iOS behavior, not just DOM presence
Seeing the tag in DevTools is necessary but not sufficient. Test by:
- Opening the site in Safari on iPhone.
- Adding it to the home screen.
- Launching it from the home screen.
- Confirming whether it opens in standalone mode without normal browser chrome.
This is critical because some metadata bugs are visible only in actual launch behavior.
Common Edge Cases
1. Duplicate meta tags
If both the metadata API and manual head injection output competing Apple tags, Next.js or the browser may deduplicate unpredictably. Always inspect final HTML and keep only the tags you truly need.
2. App Router metadata conflicts
If you define metadata in multiple nested layouts, parent and child merging can produce surprising head output. A child layout may override assumptions made in the root layout.
3. Static export versus server rendering differences
Some teams test in development only. Always compare development, production build, and exported output because metadata processing can differ across modes.
npm run build
npm run start
4. iOS version inconsistencies
Different Safari versions may handle legacy tags differently. A fix that appears unnecessary on a newer device can still matter on older supported versions.
5. PWA expectations on non-Apple browsers
apple-mobile-web-app-capable is Apple-specific. It does not replace your manifest or broader installability configuration for Chromium-based browsers.
6. CSP or HTML transforms
If you use a CDN, edge middleware, or a custom HTML transform pipeline, the tag may be removed after Next.js renders it. Check the final response delivered to the device.
FAQ
Should I remove apple-mobile-web-app-capable because it is considered legacy?
No, not if your app still depends on it for Safari home-screen behavior. Legacy does not mean harmless to remove. Keep it until your supported device matrix proves it is unnecessary.
Is display: standalone in manifest.json enough?
Not always. For Apple platforms, manifest support has historically differed from Chromium behavior. Many production apps keep both the manifest settings and Apple-specific meta tags for reliability.
What is the safest short-term workaround while waiting for a Next.js fix?
The safest approach is to explicitly inject the meta tag, verify it exists in final HTML, test on a real iOS device, and pin the framework version if the current release still strips it.
The practical takeaway is straightforward: if your application intentionally sets apple-mobile-web-app-capable, Next.js should not silently remove it. Until upstream behavior changes, preserve the tag manually, validate the rendered output, and test actual iOS standalone launches before shipping.