Skip to content

Hydration failure with useId() and AG Grid Enterprise #84029

@rwalisa

Description

@rwalisa

Link to the code that reproduces this issue

https://github.com/rwalisa/nextjs-useid-hydration-bug-demo/

To Reproduce

  1. Start the application in development, or build and run the server
  2. Open the index page
  3. In case the error doesn't appear, refresh it
  4. Remove line 7 in Component.jsx
  5. Refresh the page to see that the error is gone

Current vs. Expected behavior

Hydration fails, because useId() returns _R_clrlb_ on the server and _R_4lrlb_ on the client.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.0.0: Mon Aug 25 21:16:39 PDT 2025; root:xnu-12377.1.9~3/RELEASE_ARM64_T6031
  Available memory (MB): 36864
  Available CPU cores: 14
Binaries:
  Node: 24.8.0
  npm: 11.6.0
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.5.3 // Latest available version is detected (15.5.3).
  eslint-config-next: 15.5.3
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.9.2
Next.js Config:
  output: N/A

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

React

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

next dev (local), next build (local), next start (local)

Additional context

The issue happens starting from Next.js v15.4.2-canary.20. v15.4.2-canary.19 works as expected. All patch versions in 15.5.x are affected.

It only happens when AG Grid Enterprise is imported in a client component (not necessarily the one that calls useId()) and referenced in the code by accessing any of its exports. Since the imported package doesn't import React, I think it's an issue with Next.js module resolution.

Importing AG Grid Community doesn't trigger the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ReactRelated to React.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions