You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A user working on a document that contained an array of blocks lost access to the document as a block became undefined (possibly while reordering blocks).
Attached is an image that shows the state of the field in the document - Object for block 6 (array index position 7) is now undefined.
We then receive the following server error:
ERROR: Block with type "undefined" was found in block data, but no block with that type is defined in the config for field with schema path pages.content.
The user is then unable to edit the document - receiving a blank document edit screen - as shown below...
Apologies for the link above - we've not immediately been able to reproduce this however it results in the loss of data, and was confirmed as an issue independently by a second user in Discord (@JannikZed) and so I felt this was serious enough to warrant the issue here.
Even if the issue can't be immediately resolved, I was wondering if it might be possible to more defensively code for block rendering, so that only the missing / undefined block show's as an error. The user would still be able to access the rest of the document - optionally removing the undefined block so that they can continue working on the document (despite the loss of data in the undefined block).
Hope this helps.
Which area(s) are affected? (Select all that apply)
area: core
Environment Info
Payload: v3.15.0
Node.js: v22.13.0 (LTS)
The text was updated successfully, but these errors were encountered:
Describe the Bug
A user working on a document that contained an array of blocks lost access to the document as a block became undefined (possibly while reordering blocks).
The problem was recently posted to Discord - https://discord.com/channels/967097582721572934/1102950643259424828/1326859801761939477 . Another user there (@JannikZed) also described having the same issue.
Attached is an image that shows the state of the field in the document - Object for block 6 (array index position 7) is now undefined.
We then receive the following server error:
ERROR: Block with type "undefined" was found in block data, but no block with that type is defined in the config for field with schema path pages.content.
The user is then unable to edit the document - receiving a blank document edit screen - as shown below...
Link to the code that reproduces this issue
https://github.com/payloadcms/payload
Reproduction Steps
Apologies for the link above - we've not immediately been able to reproduce this however it results in the loss of data, and was confirmed as an issue independently by a second user in Discord (@JannikZed) and so I felt this was serious enough to warrant the issue here.
Even if the issue can't be immediately resolved, I was wondering if it might be possible to more defensively code for block rendering, so that only the missing / undefined block show's as an error. The user would still be able to access the rest of the document - optionally removing the undefined block so that they can continue working on the document (despite the loss of data in the undefined block).
Hope this helps.
Which area(s) are affected? (Select all that apply)
area: core
Environment Info
The text was updated successfully, but these errors were encountered: