Skip to content

Flooded with warnings in console for collection that has either group or array in v3.37.0 #12377

@anyuj

Description

@anyuj

Describe the Bug

After upgrade to 3.37.0, when you visit a collection that has array or group and refresh the page, it will spamming multiple lines of warning in the console.
Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().

Link to the code that reproduces this issue

https://github.com/anyuj/flooded-warnings

Reproduction Steps

Use the above repo or:

  1. Init a payload blank template
  2. Create collection either with array or group
  3. Visit the collection page, and refresh the page. The warnings will show up.

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

Any collection that has either a group or an array field

Environment Info

Payload: 3.37.0
Next.js: 15.3.2
Node: 22.13.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions