payload icon indicating copy to clipboard operation
payload copied to clipboard

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

Open anyuj opened this issue 7 months ago • 6 comments

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

anyuj avatar May 11 '25 15:05 anyuj

Issue started when updating payload to 3.37.0 In my setup it happens on a collection with Upload functionality when the imageSizes array is defined. If I remove imageSizes altogether, the warnings disappear.

Reproduction Steps

  1. Init a payload blank template
  2. Create collection with Upload functionality
  3. add at least 1 configuration to the imageSizes array
  4. Visit the collection page, and refresh the page. The warnings will show up.

Which area(s) are affected?

  • any collection with Upload functionality and imageSizes array
  • any collection with a field of type upload, relationTo the collection defined with imageSizes array

Env

Payload: 3.37.0
Next.js: 15.3.2
Node: 20.17.0

alexrah avatar May 12 '25 19:05 alexrah

Having same issue

"next": "15.3.1",
"payload": "3.37.0",

Image

zegie avatar May 12 '25 20:05 zegie

Having this issue as well when updating to 3.37.

C947326 avatar May 25 '25 09:05 C947326

same for 3.39.1

tuphuc avatar May 26 '25 07:05 tuphuc

Have the same issue, but only while using Firefox.

Amar2Kk avatar May 29 '25 21:05 Amar2Kk

Same issues in 3.39.1, It happened when I added my own cell custom component to my field:

{
      name: "images",
      type: "relationship",
      relationTo: "media",
      hasMany: true,
      admin: {
        components: {
          Cell: "/components/Application/PayloadAdmin/ProductThumbnail"
        },
      }
    },

zenovak avatar Jun 01 '25 10:06 zenovak

For me, this happens after updating to 3.38.0. It only appears in dev mode (both with and without turbopack).

No issues on 3.37.0. Issue remains on 3.39.0, 3.39.1 and 3.40.0.

The errors appear when I refresh the admin UI on a collection with array or group.

Crustan avatar Jun 04 '25 07:06 Crustan

🚀 This is included in version v3.41.0

github-actions[bot] avatar Jun 05 '25 14:06 github-actions[bot]

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.

github-actions[bot] avatar Jun 13 '25 05:06 github-actions[bot]