nextjs - 💡(How to fix) Fix [Turbopack] rootParams: next/root-params has no exports - compiler does not generate named param functions [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#92740Fetched 2026-04-15 06:18:38
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
closed ×1commented ×1labeled ×1locked ×1

Error Message

Error: Expected the resume to render <div> in this slot but instead it rendered <next_metadata_boundary>

Root Cause

  1. rootParams: true + import * as rootParams from "next/root-params" → build fails (this issue)
  2. Restructuring layouts (moving <html>/<body> from app/layout.tsx to app/[locale]/layout.tsx) → same build failure
  3. next build --webpack → works for root-params but fails because fumadocs-mdx uses Turbopack-only schemes
  4. Explicit locale in getTranslations({ locale, namespace }) → already done, does not fix the PPR metadata boundary error
  5. 'use cache' in generateMetadata → already done per docs, correct but insufficient
  6. Upgrading from 16.2.2 to 16.2.3 → same issue

Code Example

Operating System: macOS Darwin 24.6.0
Next.js: 16.2.3
Node.js: v25.8.2
Turbopack: stable (default)
next-intl: 4.9.0

---

Export locale doesn't exist in target module

> 1 | import * as rootParams from "next/root-params";
  |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The export locale was not found in module [next]/root-params.js [app-rsc] (ecmascript).
The module has no exports at all.

---

throw new Error("This module is a placeholder for 'next/root-params' and should be replaced by the compiler.")

---

Error: Expected the resume to render <div> in this slot but instead it rendered <__next_metadata_boundary__>

---

app/
  layout.tsx          ← renders <html> and <body>
  [locale]/
    layout.tsx        ← i18n providers, generateStaticParams
    (site)/
      customs/
        nomenclature/[goodsCode]/page.tsx'use cache' in generateMetadata
        trade/[code]/page.tsx
        origin/preferential/[agreementId]/[hsCode]/page.tsx~15K errors/day

---

const nextConfig: NextConfig = {
  cacheComponents: true,
  experimental: {
    rootParams: true, // ← enabled, but Turbopack ignores it
  },
};
RAW_BUFFERClick to expand / collapse

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System: macOS Darwin 24.6.0
Next.js: 16.2.3
Node.js: v25.8.2
Turbopack: stable (default)
next-intl: 4.9.0

Which area(s) are affected?

Turbopack, PPR (Partial Prerendering), Internationalization (i18n)

Link to reproduction

Private repo, but easily reproducible with any Next.js 16 app with [locale] dynamic segment.

Describe the bug

When using rootParams: true in next.config.ts, the Turbopack compiler does not generate the named exports from next/root-params. The build fails with:

Export locale doesn't exist in target module

> 1 | import * as rootParams from "next/root-params";
  |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The export locale was not found in module [next]/root-params.js [app-rsc] (ecmascript).
The module has no exports at all.

The next/root-params.js at the package root is a placeholder:

throw new Error("This module is a placeholder for 'next/root-params' and should be replaced by the compiler.")

The actual implementation exists in dist/server/request/root-params.js (with getRootParam function), but Turbopack never generates the per-segment named exports (e.g. locale()) that the docs describe.

Context: why this matters

This blocks all i18n libraries from working with cacheComponents: true (PPR). As documented in:

  • next-intl#1493 - "cacheComponents is not supported yet"
  • next.js#86870 - "Every big localization framework breaks with cache components"

The result is ~15,000 errors/day in production:

Error: Expected the resume to render <div> in this slot but instead it rendered <__next_metadata_boundary__>

Pages return HTTP 200 with correct content but fall back to CSR instead of PPR prerender.

What was tried

  1. rootParams: true + import * as rootParams from "next/root-params" → build fails (this issue)
  2. Restructuring layouts (moving <html>/<body> from app/layout.tsx to app/[locale]/layout.tsx) → same build failure
  3. next build --webpack → works for root-params but fails because fumadocs-mdx uses Turbopack-only schemes
  4. Explicit locale in getTranslations({ locale, namespace }) → already done, does not fix the PPR metadata boundary error
  5. 'use cache' in generateMetadata → already done per docs, correct but insufficient
  6. Upgrading from 16.2.2 to 16.2.3 → same issue

App structure

app/
  layout.tsx          ← renders <html> and <body>
  [locale]/
    layout.tsx        ← i18n providers, generateStaticParams
    (site)/
      customs/
        nomenclature/[goodsCode]/page.tsx  ← 'use cache' in generateMetadata
        trade/[code]/page.tsx
        origin/preferential/[agreementId]/[hsCode]/page.tsx  ← ~15K errors/day

next.config.ts

const nextConfig: NextConfig = {
  cacheComponents: true,
  experimental: {
    rootParams: true, // ← enabled, but Turbopack ignores it
  },
};

Expected behavior

With rootParams: true, Turbopack should generate named exports in next/root-params based on the dynamic route segments (e.g. export function locale(): Promise<string>), allowing i18n libraries to access params inside 'use cache' boundaries.

Actual behavior

Turbopack does not generate any exports. The module has no exports at all. Build fails.

extent analysis

TL;DR

The most likely fix involves resolving the issue with Turbopack not generating named exports for next/root-params when rootParams: true is enabled in next.config.ts.

Guidance

  • Verify that the next/root-params module is correctly configured and that the rootParams: true option is properly set in next.config.ts.
  • Check if there are any known issues or limitations with Turbopack and rootParams in the current version of Next.js (16.2.3).
  • Consider trying a different approach to access route parameters, such as using use params from next/navigation or exploring alternative i18n libraries that may not rely on rootParams.
  • Review the app structure and ensure that the layout.tsx files are correctly set up to handle internationalization and route parameters.

Example

No specific code example can be provided without further information, but reviewing the next.config.ts file and the app directory structure may help identify potential issues.

Notes

The issue seems to be related to a specific combination of Next.js, Turbopack, and i18n libraries, which may require a customized solution or a workaround.

Recommendation

Apply a workaround, such as using a different approach to access route parameters or exploring alternative i18n libraries, as the current issue with Turbopack and rootParams may not have a straightforward fix.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

With rootParams: true, Turbopack should generate named exports in next/root-params based on the dynamic route segments (e.g. export function locale(): Promise<string>), allowing i18n libraries to access params inside 'use cache' boundaries.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING