Replies: 4 comments 6 replies
-
I found similar topic without answer. I think it is related to my issue... #11369 |
Beta Was this translation helpful? Give feedback.
-
I found a new observation. If you create a new user and log in to the admin panel under it, go to the page where the error was, then it disappears. I don't understand how the user account can be related to this. If you log in as the "problem" user in incognito or in another browser, the error persists. |
Beta Was this translation helpful? Give feedback.
-
Ok. Next observation. If I go to user profile, change theme or anything that can change user preferences, error disappears. So I thing the problem is how PayloadCMS handles nested Tabs + saved UI preferences. |
Beta Was this translation helpful? Give feedback.
-
We are seeing a very similar issue in our installation. Nested blocks with tabs in parent and child blocks. Some users can edit fine and others get the "in operator" error. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I have really strange error that hardly to reproduce. I cannot beat for a days... Need help.
Environment
Payload Version: 3.28.0
Node Version: 20.9.0
Database: MongoDB
Operating System: Ubuntu
Description
Getting a runtime error Cannot use 'in' operator to search for 'name' in undefined when editing pages (in my case) that contain blocks with nested tabs configuration. The error occurs in PayloadCMS internal code at tabHasName function.
Sometimes error occure on globals, sometimes on collections.
Error Stack Trace
Error: Cannot use 'in' operator to search for 'name' in undefined
Call Stack
tabHasName
node_modules/payload/src/fields/config/types.ts (1888:10)
fa
node_modules/@payloadcms/ui/src/graphics/Icon/index.tsx (17:11)
node_modules/@payloadcms/ui/src/elements/StepNav/SetStepNav.tsx (15:6)
Steps to Reproduce (NOT full)
This error appear really phantomly.
I have the same on 2 different projects: 1) with pages collection; 2) with one of globals.
Expected Behavior
According to PayloadCMS types, tabs can be either NamedTab or UnnamedTab, so the name property should be optional. The configuration should work without errors.
Actual Behavior
Runtime error occurs when PayloadCMS tries to check for name property in what appears to be an undefined tab object.
Workaround
For example, I have an issue on "home" page. I find it's object in Mongo, then go to
layout.{locale}
and remove ANY block. After that refresh the page and everything is ok.If I change any other data in blocks in DB it does not help. Changing the order of block objects in
layout.{locale}
array does not help also.I do not know how this is even possible...
My pages collection config
Please, help me. I am beating with this for days...
Beta Was this translation helpful? Give feedback.
All reactions