next.js
c845bafd - Enforce route segment configs on metadata routes under Cache Components (#94962)

Commit
26 days ago
Enforce route segment configs on metadata routes under Cache Components (#94962) The React Server Components transform validates route segment configs (rejecting `runtime`, `dynamic`, `revalidate`, and friends under Cache Components) only for `page`, `layout`, and `route` entries, so metadata convention files slipped past the check. Because these files compile to route handlers and accept the same configs, this change extends the match to `icon`, `apple-icon`, `opengraph-image`, `twitter-image`, `sitemap`, `robots`, and `manifest`. Exporting `runtime = 'edge'` (or any other unsupported config) from one of them is now a compile-time error that matches the behavior for regular routes, instead of surfacing later as a confusing bundling failure. The `metadata-font` suite, which intentionally builds edge-runtime image routes, joins the other edge metadata suites that are excluded from the Cache Components test run.
Author
Parents
Loading