Skip to content

Metadata streaming: parallel route slot metadata not emitted #1341

Closed

Description

@james-elicx

This issue was created by an agent analysing CI failures from the Next.js Deploy Suite (vinext main vs Next.js v16.2.6, 2026-05-20).

Problem

Metadata from parallel route slots is not properly emitted or updated:

  1. Empty title in parallel routes. When a parallel routes layout sets metadata but does not render children, the <title> tag is empty instead of containing the layout's metadata.

  2. Stale metadata on slot navigation. Navigating between pages under a parallel route slot does not update the <title> tag. It stays on the layout's default title instead of switching to the page-specific title.

  3. Missing charset meta. The root not-found page renders without <meta charset="utf-8"> when metadata streaming is active.

Expected: "parallel-routes-default layout title"
Received: ""

Expected: "first page - @bar"
Received: "parallel-routes-default layout title"

Expected: 1  // meta[charset="utf-8"] count
Received: 0

Estimated Impact

~8 test failures across the deploy suite.

Affected Test Suites

  • test/e2e/app-dir/metadata-streaming-parallel-routes/metadata-streaming-parallel-routes.test.ts (2 failures)
  • test/e2e/app-dir/metadata-navigation/metadata-navigation.test.ts (4 failures)
  • test/e2e/app-dir/metadata-streaming/metadata-streaming.test.ts
  • test/e2e/app-dir/metadata-streaming-static-generation/metadata-streaming-static-generation.test.ts (2 failures)

Recommendation

  1. Reproduce first in vinext's own test suite. Add a test with parallel routes that set different metadata at each level and verify the correct title renders. Confirm it fails.

  2. Study Next.js metadata resolution for parallel routes. The metadata resolution logic needs to walk all slots, not just the children slot, when determining which metadata to emit.

  3. Fix client-side metadata updates during slot navigation. When navigating within a parallel route slot, the metadata should update to reflect the new page's metadata.

Activity

  1. added theissue type on May 20, 2026
  2. james-elicx commented on May 22, 2026

    @james-elicx
    MemberAuthor

    This may be regressing - observed again in the Next.js Deploy Suite nightly run on 2026-05-22 (vinext main vs Next.js v16.2.6): 8 failures across 5 test suites with symptoms matching this issue.

    Affected suites this run
    • test/e2e/app-dir/metadata-navigation/metadata-navigation.test.ts (3 failures)
    • test/e2e/app-dir/metadata-streaming-static-generation/metadata-streaming-static-generation.test.ts (2 failures)
    • test/e2e/app-dir/global-not-found/metadata/metadata.test.ts (1 failures)
    • test/e2e/app-dir/metadata-static-generation/metadata-static-generation.test.ts (1 failures)
    • test/e2e/app-dir/metadata-streaming-parallel-routes/metadata-streaming-parallel-routes.test.ts (1 failures)
  3. james-elicx commented on Jun 8, 2026

    @james-elicx
    MemberAuthor

    Triage update (agent investigation): the localized part of this issue — parallel route slot title emission when a slot layout doesn't render children — is already fixed on main by #1399 (fix(metadata): emit metadata from parallel route slots, which refs this issue): app-page-head.ts contributesTitle logic + tests/app-page-head.test.ts coverage. Verified passing on main for both SSR render and slot-to-slot navigation (@bar/first→@bar/second updates the title correctly).

    The residual deploy-suite failures (metadata-navigation, metadata-streaming-static-generation, metadata-static-generation, global-not-found/metadata) are a narrower, harder problem: <meta charset="utf-8"> / head ordering under React streaming suspension during production static generation on the not-found path — not reproducible in dev SSR and not a small localized patch. Repro recipe: prod build (vp build + Workers/static-generation Playwright project) with a not-found.tsx/global-not-found.tsx exporting generateMetadata, then assert meta[charset=utf-8] count === 1 in the streamed HTML. Likely belongs in the static-generation/streaming head emission, not app-page-head.ts. Leaving open for that residual.

  4. james-elicx commented on Jul 4, 2026

    @james-elicx
    MemberAuthor

    Closing as passing in the Next.js Deploy Suite run https://github.com/cloudflare/vinext/actions/runs/28692899743 (vinext main at 54497d42e7fa0effd567950534a3b6f562c14218, July 4, 2026). The assertions tracked by this issue passed in that run. The run still has unrelated failures, which remain tracked separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions