Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

RangeError Issue After Updating Payload to 3.30+

default discord avatar
zed0547last year
9

Hey

@299531596036571136



What's the last version that is stable for you?

  • default discord avatar
    adrian8749last year

    Hey

    @654031862146007055

    , as I already found out this is caused by some block in page builder, just doing trial and error method to find out which one

  • default discord avatar
    zed0547last year

    Aha, I see - let me know your findings!

  • default discord avatar
    adrian8749last year

    Oh It was the Carousel block...


        {
          name: "title",
          type: "richText",
          editor: lexicalEditor({
            features: ({ rootFeatures }) => {
              return [
                ...rootFeatures,
                HeadingFeature({ enabledHeadingSizes: ["h2", "h3", "h4"] }),
                FixedToolbarFeature(),
                InlineToolbarFeature(),
              ];
            },
          }),
          localized: true,
        },


    rootFeatures are creating infnite loop or something...



    Okay, i know, the defaultLexical has carousel block in it and then pages layout builder contains it too, and there is the loop

  • default discord avatar
    zed0547last year

    Hmm, so you have a blocks fields with the CarouselBlock, but then also use it in the BlocksFeature in lexical, so whenever you use the richText field in a block it nests itself



    Interesting

  • default discord avatar
    adrian8749last year

    Yeah so I was able to use CarouselBlock in richText Lexical, but carousel block itself also contained richText lexical



    that was the issue



    some old code

  • default discord avatar
    zed0547last year

    I guess a simple fix could be to just wrap the block in a function and define distinct slugs/interface name for them depending on where you introduce them in the code

  • default discord avatar
    adrian8749last year

    I just removed it, no need for that at all

  • default discord avatar
    zed0547last year

    Even better lol



    The best type of refactoring

  • default discord avatar
    adrian8749last year

    I agree

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.