payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
23.44k stars 1.49k forks source link

Lexical custom block in new document (beta 108 regression) #8371

Open andershermansen opened 7 hours ago

andershermansen commented 7 hours ago

Link to reproduction

http://localhost:3000/admin/collections/rich-text-fields/create

Environment Info

payload: 3.0.0-beta.108
next: 15.0.0-canary.160
Node: 22.9.0

Describe the Bug

Can not add custom blocks in lexical field in a new document.

This worked fine in beta 107, does not work in 108.

Reproduction Steps

Can be reproduced in payload repo: Run: pnpm dev fields Go to http://localhost:3000/admin/collections/rich-text-fields/create Add any of these custom blocks to the new document: Skjermbilde 2024-09-23 kl  14 55 19

Expected: The block to show

Actual: Just showing shimmer-effect/loader

Adapters and Plugins

No response

andershermansen commented 6 hours ago

I did a git bisect:

81a972d966bc25b04dbd652647af1ef03341d942 is the first bad commit
commit 81a972d966bc25b04dbd652647af1ef03341d942
Author: Germán Jabloñski <43938777+GermanJablo@users.noreply.github.com>
Date:   Fri Sep 20 15:42:30 2024 -0300

    chore(richtext-lexical): add strictNullChecks to the richtext-lexical package (#8295)

    This PR addresses around 500 TypeScript errors by enabling
    strictNullChecks in the richtext-lexical package. In the process,
    several bugs were identified and fixed.

    In some cases, I applied non-null assertions where necessary, although
    there may be room for further type refinement in the future. The focus
    of this PR is to resolve the immediate issues without introducing
    additional technical debt, rather than aiming for perfect type
    definitions at this stage.

    ---------

    Co-authored-by: Alessio Gravili <alessio@gravili.de>

@GermanJablo @AlessioGr

GermanJablo commented 2 hours ago

How strange, I can't reproduce it:

https://github.com/user-attachments/assets/cb649a22-a1a8-48f9-b169-ff9b55ac68bf

andershermansen commented 2 hours ago

@GermanJablo what do you mean you can not reproduce? The video is showing the shimmer-effect only and not the content in the block.

Do the same thing in one of the existing documents, and you will see the difference.

AlessioGr commented 2 hours ago

How strange, I can't reproduce it:

Your video does seem to reproduce it though (the blocks are just shimmering)

GermanJablo commented 1 hour ago

Oh yes, sorry, I don’t know what I’m saying! I'm going to work on this right now.

GermanJablo commented 12 minutes ago

Fixed in https://github.com/payloadcms/payload/pull/8378