nextjs - ✅(Solved) Fix After upgrading to Next.js 16.0.1, the build fails during prerendering of the internal /_not-found route with the following error: [3 pull requests, 11 comments, 8 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#85604Fetched 2026-04-08 02:14:55
View on GitHub
Comments
11
Participants
8
Timeline
34
Reactions
11
Timeline (top)
commented ×11subscribed ×11cross-referenced ×4referenced ×4

Error Message

Error occurred prerendering page "/_not-found". Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it. {linkComponent: function i} ^^^^^^^^^^ Export encountered an error on /_not-found/page: /_not-found, exiting the build.

Fix Action

Fixed

PR fix notes

PR #466: build(deps): bump next from 15.5.6 to 16.0.1

Description (problem / solution / changelog)

Bumps next from 15.5.6 to 16.0.1.

<details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/vercel/next.js/releases">next's releases</a>.</em></p> <blockquote> <h2>v16.0.1</h2> <h3>Core Changes</h3> <ul> <li>fix(static-paths): add depth tracking to parallel route param resolution: <a href="https://redirect.github.com/vercel/next.js/issues/85319">#85319</a></li> <li>Fix types of <code>@​next/mdx</code>: <a href="https://redirect.github.com/vercel/next.js/issues/82238">#82238</a></li> <li>Ensure getServerInsertedHTML skips rendering correctly: <a href="https://redirect.github.com/vercel/next.js/issues/85394">#85394</a></li> <li>Fix duplicate .next/types <code>include</code> on Windows: <a href="https://redirect.github.com/vercel/next.js/issues/85400">#85400</a></li> <li>Exclude <code>next-js</code> condition from middleware, proxy, and instrumentation: <a href="https://redirect.github.com/vercel/next.js/issues/85321">#85321</a></li> <li>remove unstable_forceStale prefetch option &amp; restore <code>prefetch={true}</code> functionality: <a href="https://redirect.github.com/vercel/next.js/issues/85411">#85411</a></li> <li>Upgrade React from <code>2bcbf254-20251020</code> to <code>6160773f-20251023</code>: <a href="https://redirect.github.com/vercel/next.js/issues/85277">#85277</a></li> <li>fix(next/image): swap dependencies: <a href="https://redirect.github.com/vercel/next.js/issues/85419">#85419</a></li> <li>Handle <code>Origin: null</code> headers: <a href="https://redirect.github.com/vercel/next.js/issues/85402">#85402</a></li> <li>Generalize Segment Cache fallback implementation: <a href="https://redirect.github.com/vercel/next.js/issues/84652">#84652</a></li> <li>fix: ensure req.query is writable: <a href="https://redirect.github.com/vercel/next.js/issues/81573">#81573</a></li> <li>fix: Proxy not picked up on Windows: <a href="https://redirect.github.com/vercel/next.js/issues/85443">#85443</a></li> <li>[test] Ensure we can toggle the DevTools menu while status indicators are active: <a href="https://redirect.github.com/vercel/next.js/issues/85456">#85456</a></li> <li>Fix crash when suspending in Components using <code>useActionQueue</code>: <a href="https://redirect.github.com/vercel/next.js/issues/85459">#85459</a></li> </ul> <h3>Misc Changes</h3> <ul> <li>docs: create-next-app react-compiler and new prompts: <a href="https://redirect.github.com/vercel/next.js/issues/85213">#85213</a></li> <li>docs: cache components - introduction: <a href="https://redirect.github.com/vercel/next.js/issues/85196">#85196</a></li> <li>docs: use cache feedback: <a href="https://redirect.github.com/vercel/next.js/issues/85169">#85169</a></li> <li>docs: stabilize apis in docs: <a href="https://redirect.github.com/vercel/next.js/issues/85219">#85219</a></li> <li>docs: revalidateTag immediate expiration in Route Handlers: <a href="https://redirect.github.com/vercel/next.js/issues/85223">#85223</a></li> <li>Docs/use cache feedback 2: <a href="https://redirect.github.com/vercel/next.js/issues/85222">#85222</a></li> <li>docs: added <code>use cache: remote</code> docs: <a href="https://redirect.github.com/vercel/next.js/issues/85145">#85145</a></li> <li>docs: proxy runtime defaults to nodejs: <a href="https://redirect.github.com/vercel/next.js/issues/85204">#85204</a></li> <li>chore: cache components feedback: <a href="https://redirect.github.com/vercel/next.js/issues/85241">#85241</a></li> <li>docs: add a note that cache components is opt-in near the top: <a href="https://redirect.github.com/vercel/next.js/issues/85245">#85245</a></li> <li>Docs/v16 feedback: <a href="https://redirect.github.com/vercel/next.js/issues/85259">#85259</a></li> <li>Update command to install babel-plugin-react-compiler as a devDependency: <a href="https://redirect.github.com/vercel/next.js/issues/85235">#85235</a></li> <li>docs: typegen next-env.d.ts feedback: <a href="https://redirect.github.com/vercel/next.js/issues/85273">#85273</a></li> <li>docs: link to MCP guide from upgrade: <a href="https://redirect.github.com/vercel/next.js/issues/85308">#85308</a></li> <li>docs: regexp removed from middleware config: <a href="https://redirect.github.com/vercel/next.js/issues/85343">#85343</a></li> <li>docs: simplify MCP guide to focus on next-devtools-mcp: <a href="https://redirect.github.com/vercel/next.js/issues/85353">#85353</a></li> <li>docs: fix proxy matcher overflow: <a href="https://redirect.github.com/vercel/next.js/issues/85337">#85337</a></li> <li>docs: point out diff in serialization types for arguments and return values: <a href="https://redirect.github.com/vercel/next.js/issues/85338">#85338</a></li> <li>[test] Update snapshots: <a href="https://redirect.github.com/vercel/next.js/issues/85407">#85407</a></li> <li>docs: Fix typo in SEO section of loading.mdx: <a href="https://redirect.github.com/vercel/next.js/issues/85301">#85301</a></li> <li>Fix typo in Fast Refresh documentation: <a href="https://redirect.github.com/vercel/next.js/issues/85352">#85352</a></li> <li>Fix grammatical errors in updating data documentation: <a href="https://redirect.github.com/vercel/next.js/issues/85067">#85067</a></li> <li>[test] Skip devlow benchmarks on PRs: <a href="https://redirect.github.com/vercel/next.js/issues/85408">#85408</a></li> <li>[test] Unflake typed-env suite: <a href="https://redirect.github.com/vercel/next.js/issues/85410">#85410</a></li> <li>Update rust toolchain to 2025-10-27: <a href="https://redirect.github.com/vercel/next.js/issues/85409">#85409</a></li> <li>[test] Speed up prefetching suite: <a href="https://redirect.github.com/vercel/next.js/issues/85417">#85417</a></li> <li>docs: remove inaccuracies from use cache: private: <a href="https://redirect.github.com/vercel/next.js/issues/85425">#85425</a></li> <li>[test] Exclude Next.js internal stack frames from cache-component-error CLI output assertions: <a href="https://redirect.github.com/vercel/next.js/issues/85421">#85421</a></li> <li>[test] Exclude likely Next.js internal Components from component stacks in Redbox assertions: <a href="https://redirect.github.com/vercel/next.js/issues/85420">#85420</a></li> <li>Turbopack: correctly trace files with npm: <a href="https://redirect.github.com/vercel/next.js/issues/85323">#85323</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/vercel/next.js/commit/e08402bfad8db05b0df820daf4f08c9c65ab1f7b"><code>e08402b</code></a> v16.0.1</li> <li><a href="https://github.com/vercel/next.js/commit/51d9631e571a04a50dbf33259c81893c48ab3eca"><code>51d9631</code></a> Upgrade React from <code>6160773f-20251023</code> to <code>b4455a6e-20251027</code> (<a href="https://redirect.github.com/vercel/next.js/issues/85464">#85464</a>)</li> <li><a href="https://github.com/vercel/next.js/commit/163fc17a46f79901c5910ebd540ae8bb8e47e3ef"><code>163fc17</code></a> v16.0.1-canary.6</li> <li><a href="https://github.com/vercel/next.js/commit/a986e1731d60ed02749ab0fb64fe581dc35e04a5"><code>a986e17</code></a> Fix crash when suspending in Components using <code>useActionQueue</code> (<a href="https://redirect.github.com/vercel/next.js/issues/85459">#85459</a>)</li> <li><a href="https://github.com/vercel/next.js/commit/406721415df918d4eda14a54d1866569aeb5765b"><code>4067214</code></a> Turbopack: correctly trace files with npm (<a href="https://redirect.github.com/vercel/next.js/issues/85323">#85323</a>)</li> <li><a href="https://github.com/vercel/next.js/commit/976a2222f0dfb9cd01fd83439bffca5bf10cf49d"><code>976a222</code></a> [test] Ensure we can toggle the DevTools menu while status indicators are act...</li> <li><a href="https://github.com/vercel/next.js/commit/b95dbe6a3a79a459173557a3b670eb6cb2c6d060"><code>b95dbe6</code></a> fix: Proxy not picked up on Windows (<a href="https://redirect.github.com/vercel/next.js/issues/85443">#85443</a>)</li> <li><a href="https://github.com/vercel/next.js/commit/b0837e0f2451bfe420b082109f259122bf676298"><code>b0837e0</code></a> [test] Exclude likely Next.js internal Components from component stacks in Re...</li> <li><a href="https://github.com/vercel/next.js/commit/456d8e7b8c0f1f11fa9d290ccc916c6c686d5081"><code>456d8e7</code></a> fix: ensure req.query is writable (<a href="https://redirect.github.com/vercel/next.js/issues/81573">#81573</a>)</li> <li><a href="https://github.com/vercel/next.js/commit/0b6fe158c61fec5f30289856a3d1c078b0be7022"><code>0b6fe15</code></a> [test] Exclude Next.js internal stack frames from cache-component-error CLI o...</li> <li>Additional commits viewable in <a href="https://github.com/vercel/next.js/compare/v15.5.6...v16.0.1">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>

Changed files

  • package-lock.json (modified, +207/-199)
  • package.json (modified, +1/-1)

PR #472: build(deps): bump next from 15.5.6 to 16.0.3

Description (problem / solution / changelog)

Bumps next from 15.5.6 to 16.0.3.

<details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/vercel/next.js/releases">next's releases</a>.</em></p> <blockquote> <h2>v16.0.3</h2> <h3>Core Changes</h3> <ul> <li>fix: Rspack throw error when using ForceCompleteRuntimePlugin: <a href="https://redirect.github.com/vercel/next.js/issues/85221">#85221</a></li> <li>fix: build CLI output not displaying Proxy (Middleware) when nodejs runtime: <a href="https://redirect.github.com/vercel/next.js/issues/85403">#85403</a></li> <li>fix: staleTimes.static should consistently enforce a 30s minimum: <a href="https://redirect.github.com/vercel/next.js/issues/85479">#85479</a></li> <li>[turbopack] fix build of empty entries of pages: <a href="https://redirect.github.com/vercel/next.js/issues/84873">#84873</a></li> <li>Cache the head separately from the route tree: <a href="https://redirect.github.com/vercel/next.js/issues/84724">#84724</a></li> <li>Allow inspecting dev server on default port with <code>next dev --inspect</code>: <a href="https://redirect.github.com/vercel/next.js/issues/85037">#85037</a></li> <li>Avoid proxying React modules through workUnitStore: <a href="https://redirect.github.com/vercel/next.js/issues/85486">#85486</a></li> <li>fix: redirect should always return updated router state: <a href="https://redirect.github.com/vercel/next.js/issues/85533">#85533</a></li> <li>Upgrade React from <code>b4455a6e-20251027</code> to <code>4f931700-20251029</code>: <a href="https://redirect.github.com/vercel/next.js/issues/85518">#85518</a></li> <li>[turbopack] Move generation of <code>cacheLife</code> types out of the webpack plugin and into the dev bundler directly: <a href="https://redirect.github.com/vercel/next.js/issues/85539">#85539</a></li> <li>Ensure user-space stack frame for <code>'use cache'</code> in page/layout component: <a href="https://redirect.github.com/vercel/next.js/issues/85519">#85519</a></li> <li>Update parallel routes in build-complete: <a href="https://redirect.github.com/vercel/next.js/issues/85546">#85546</a></li> <li>fully remove clientSegmentCache flag: <a href="https://redirect.github.com/vercel/next.js/issues/85541">#85541</a></li> <li>[turbopack] Support relative paths in turbopack source maps.: <a href="https://redirect.github.com/vercel/next.js/issues/85146">#85146</a></li> <li>Release unnecessary memory on hydration finish: <a href="https://redirect.github.com/vercel/next.js/issues/84967">#84967</a></li> <li>Preserve interception markers in parameter types: <a href="https://redirect.github.com/vercel/next.js/issues/85526">#85526</a></li> <li>move segment cache entries to top level segment-cache dir: <a href="https://redirect.github.com/vercel/next.js/issues/85542">#85542</a></li> <li>Upgrade React from <code>4f931700-20251029</code> to <code>561ee24d-20251101</code>: <a href="https://redirect.github.com/vercel/next.js/issues/85670">#85670</a></li> <li>[devtools] Remove title from preferences: <a href="https://redirect.github.com/vercel/next.js/issues/85698">#85698</a></li> <li>Update font data: <a href="https://redirect.github.com/vercel/next.js/issues/85708">#85708</a></li> <li>Don't invalidate hot reloader excessively during dev server boot: <a href="https://redirect.github.com/vercel/next.js/issues/85732">#85732</a></li> <li>[codemod] fix: next-lint-to-eslint-cli did not handle <code>'next'</code> plugin: <a href="https://redirect.github.com/vercel/next.js/issues/85749">#85749</a></li> <li>Upgrade React from <code>561ee24d-20251101</code> to <code>67f7d47a-20251103</code>: <a href="https://redirect.github.com/vercel/next.js/issues/85762">#85762</a></li> <li>Tracing: Fix memory leak in span map: <a href="https://redirect.github.com/vercel/next.js/issues/85529">#85529</a></li> <li>Fix documentation typo in refresh function: <a href="https://redirect.github.com/vercel/next.js/issues/85696">#85696</a></li> <li>fix: eslint-config-next types was exporting to dist/src: <a href="https://redirect.github.com/vercel/next.js/issues/85768">#85768</a></li> <li>Upgrade React from <code>67f7d47a-20251103</code> to <code>f646e8ff-20251104</code>: <a href="https://redirect.github.com/vercel/next.js/issues/85772">#85772</a></li> <li>remove unused RSC payload property: <a href="https://redirect.github.com/vercel/next.js/issues/85746">#85746</a></li> <li>[runtime prefetching]: fix runtime prefetching when deployed: <a href="https://redirect.github.com/vercel/next.js/issues/85595">#85595</a></li> <li>Turbopack: next build --analyze: <a href="https://redirect.github.com/vercel/next.js/issues/85197">#85197</a></li> <li>Build: Log amount of workers during static generation: <a href="https://redirect.github.com/vercel/next.js/issues/85706">#85706</a></li> <li>Upgrade React from <code>f646e8ff-20251104</code> to <code>dd048c3b-20251105</code>: <a href="https://redirect.github.com/vercel/next.js/issues/85819">#85819</a></li> <li>Sync devFallbackParams when generateStaticParams change: <a href="https://redirect.github.com/vercel/next.js/issues/85741">#85741</a></li> <li>chore: upgrade rspack 1.6.0: <a href="https://redirect.github.com/vercel/next.js/issues/84210">#84210</a></li> <li>[mcp] get_routes mcp tool: <a href="https://redirect.github.com/vercel/next.js/issues/85773">#85773</a></li> <li>Split each path param into a separate cache key : <a href="https://redirect.github.com/vercel/next.js/issues/85758">#85758</a></li> <li>[turbopack] change server source maps in production to use relative paths: <a href="https://redirect.github.com/vercel/next.js/issues/85576">#85576</a></li> <li>fix: skip collecting metadata for app-error in webpack: <a href="https://redirect.github.com/vercel/next.js/issues/85892">#85892</a></li> <li>fix: support root span attributes with a custom server: <a href="https://redirect.github.com/vercel/next.js/issues/85521">#85521</a></li> <li>fix isDynamicRSC condition when deployed: <a href="https://redirect.github.com/vercel/next.js/issues/85919">#85919</a></li> <li>[turbopack] Make it possible to synchronously access native bindings: <a href="https://redirect.github.com/vercel/next.js/issues/85787">#85787</a></li> <li>Upgrade React from <code>dd048c3b-20251105</code> to <code>fa50caf5-20251107</code>: <a href="https://redirect.github.com/vercel/next.js/issues/85906">#85906</a></li> <li>Fix telemetry event loss on build failures and server shutdown: <a href="https://redirect.github.com/vercel/next.js/issues/85867">#85867</a></li> <li>Remove one stack frame from <code>'use cache'</code> call stacks: <a href="https://redirect.github.com/vercel/next.js/issues/85966">#85966</a></li> <li>Upgrade React from <code>fa50caf5-20251107</code> to <code>52684925-20251110</code>: <a href="https://redirect.github.com/vercel/next.js/issues/85980">#85980</a></li> <li>Deployment adapter: fix metadata for &quot;/&quot; route: <a href="https://redirect.github.com/vercel/next.js/issues/85820">#85820</a></li> <li>Enable React's default Transition indicator behind a flag: <a href="https://redirect.github.com/vercel/next.js/issues/86000">#86000</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/vercel/next.js/commit/2eda33ce846f996ff627c7e8b64704259ecd4355"><code>2eda33c</code></a> v16.0.3</li> <li><a href="https://github.com/vercel/next.js/commit/00cb5d9953fa0590796c39fc7acfb78dd1d91512"><code>00cb5d9</code></a> perf: revert to use the light safe stringify for is-error (<a href="https://redirect.github.com/vercel/next.js/issues/86053">#86053</a>)</li> <li><a href="https://github.com/vercel/next.js/commit/de6bc159575680a8cfdfda518ae61120509c34a2"><code>de6bc15</code></a> docs: keywords in system reqs and add browserslist (<a href="https://redirect.github.com/vercel/next.js/issues/85838">#85838</a>)</li> <li><a href="https://github.com/vercel/next.js/commit/a51b80449ecd45c590bf1d468bed3e094c17e350"><code>a51b804</code></a> docs: cacheHandlers (<a href="https://redirect.github.com/vercel/next.js/issues/85311">#85311</a>)</li> <li><a href="https://github.com/vercel/next.js/commit/a63951f4ae4590cbbe293dc8904263063f6c98f9"><code>a63951f</code></a> Turbopack: remove unused function (<a href="https://redirect.github.com/vercel/next.js/issues/85974">#85974</a>)</li> <li><a href="https://github.com/vercel/next.js/commit/8c29c118fb53300c42087267f9cae7c8350600bf"><code>8c29c11</code></a> Update authentication.mdx: Fix <code>Auth0</code> Link (<a href="https://redirect.github.com/vercel/next.js/issues/85953">#85953</a>)</li> <li><a href="https://github.com/vercel/next.js/commit/25716c8ec3ad8cd89f9d4824b73d31fa4c196848"><code>25716c8</code></a> Deployment adapter: fix metadata for &quot;/&quot; route (<a href="https://redirect.github.com/vercel/next.js/issues/85820">#85820</a>)</li> <li><a href="https://github.com/vercel/next.js/commit/bf9c900407a3a5414a7a9844443ec1d12a531e80"><code>bf9c900</code></a> Upgrade React from <code>fa50caf5-20251107</code> to <code>52684925-20251110</code> (<a href="https://redirect.github.com/vercel/next.js/issues/85980">#85980</a>)</li> <li><a href="https://github.com/vercel/next.js/commit/4212a8642e46eae399b2e73da6e617266732f303"><code>4212a86</code></a> switch to slice in createRuntimePrefetchTransformStream (<a href="https://redirect.github.com/vercel/next.js/issues/85822">#85822</a>)</li> <li><a href="https://github.com/vercel/next.js/commit/07a86572942e67cb04bf7e0a4f2b30edfc1a8171"><code>07a8657</code></a> Fix Turbopack local font <code>font-family</code> declaration (<a href="https://redirect.github.com/vercel/next.js/issues/85913">#85913</a>)</li> <li>Additional commits viewable in <a href="https://github.com/vercel/next.js/compare/v15.5.6...v16.0.3">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>

Changed files

  • package-lock.json (modified, +207/-199)
  • package.json (modified, +1/-1)

PR #511: chore: Bump Next.js to 15.5.10 to fix vulnerability

Description (problem / solution / changelog)

I wish we could merge #510 instead, but https://github.com/vercel/next.js/issues/85604 exists.

Changed files

  • package-lock.json (modified, +8/-8)
  • package.json (modified, +1/-1)

Code Example

Error occurred prerendering page "/_not-found".
Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.
  {linkComponent: function i}
                  ^^^^^^^^^^
Export encountered an error on /_not-found/page: /_not-found, exiting the build.

---

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home Single Language
  Available memory (MB): 16168
  Available CPU cores: 8
Binaries:
  Node: 22.19.0
  npm: 10.9.3
  Yarn: 1.22.19
  pnpm: 10.20.0
Relevant Packages:
  next: 16.0.1 // Latest available version is detected (16.0.1).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A
Done in 3.06s.
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/md2docx/mdast2docx/tree/a9078b882ec58f3cdafb68446c8d0c679a1907b8/examples/nextjs

To Reproduce

  1. clone repo and install dependencies
  2. run build command

Current vs. Expected behavior

Current:

Build fails with following error:

Error occurred prerendering page "/_not-found".
Error: Functions cannot be passed directly to Client Components unless you explicitly expose it by marking it with "use server". Or maybe you meant to call this function rather than return it.
  {linkComponent: function i}
                  ^^^^^^^^^^
Export encountered an error on /_not-found/page: /_not-found, exiting the build.

Expected: should build without errors as with next.js 15

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home Single Language
  Available memory (MB): 16168
  Available CPU cores: 8
Binaries:
  Node: 22.19.0
  npm: 10.9.3
  Yarn: 1.22.19
  pnpm: 10.20.0
Relevant Packages:
  next: 16.0.1 // Latest available version is detected (16.0.1).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A
Done in 3.06s.

Which area(s) are affected? (Select all that apply)

Not sure

Which stage(s) are affected? (Select all that apply)

next build (local)

Additional context

No response

extent analysis

TL;DR

The build failure is likely due to a change in Next.js 16 that requires explicit exposure of server components, and marking the function with "use server" may resolve the issue.

Guidance

  • Review the code in the _not-found page to identify the function being passed directly to a Client Component and consider marking it with "use server" to explicitly expose it.
  • Check the Next.js documentation for examples of how to use the "use server" directive to expose server components to client components.
  • Verify that the function is not being returned instead of called, as suggested by the error message.
  • Consider downgrading to Next.js 15 if the issue is blocking and a fix cannot be implemented quickly.

Example

No code snippet is provided as the issue does not include the specific code that is causing the error.

Notes

The issue appears to be related to a change in Next.js 16, and the solution may involve updating the code to comply with the new requirements. However, without more information about the specific code causing the error, it is difficult to provide a more detailed solution.

Recommendation

Apply workaround: The best course of action is to update the code to mark the function with "use server" to explicitly expose it, as this is the recommended solution by the Next.js error message.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

nextjs - ✅(Solved) Fix After upgrading to Next.js 16.0.1, the build fails during prerendering of the internal /_not-found route with the following error: [3 pull requests, 11 comments, 8 participants]