Skip to content

Next 14. Cannot access displayName.valueOf on the server #57586

@Andrew9614

Description

@Andrew9614

Link to the code that reproduces this issue

https://github.com/Andrew9614/next14-bug

To Reproduce

  1. Start next dev
  2. Error

Current vs. Expected behavior

Expected: default missing key prop error in console
Current: Unhandled Runtime Error; Cannot access displayName.valueOf on the server. You cannot dot into a client module from a server component. You can only pass the imported name through.

Verify canary release

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

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
Binaries:
  Node: 20.9.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.0.0
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: N/A
Next.js Config:
  output: N/A

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

Not sure

Additional context

If within server component using client component and it has children array without key prop it throw Unhandled Runtime Error "Error: Cannot access displayName.valueOf on the server. You cannot dot into a client module from a server component. You can only pass the imported name through." on parent component

image

Options to work around the problem:

  • add key prop
  • delete 'use client' in Bug component
  • add 'use client' in page.jsx

NEXT-2032

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.linear: nextConfirmed issue that is tracked by the Next.js team.locked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions