Skip to content

After upgrading to Next.js 16.0.1, the build fails during prerendering of the internal /_not-found route with the following error:Β #85604

@mayank1513

Description

@mayank1513

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions