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.

Unable to remove upload feature from Lexical editor

default discord avatar
kalon_robsonlast year
4

@alessiogr Hope you don't mind me tagging you in on this. I didn't want to flag it as a bug until verified



I've attempted to filter out the upload feature from the editor using


    {
      name: 'content',
      type: 'richText',
      editor: lexicalEditor({
        features: ({ defaultFeatures }) => [
          ...defaultFeatures.filter((feature) => !['relationship', 'upload'].includes(feature.key)),
        ],
      }),
    },


But it seems somewhere the editor relies on this being present. (See screenshot)



Browser console log


Lexical.dev.js:9212  Uncaught Error: parseEditorState: type "upload" + not found
    at $parseSerializedNodeImpl (Lexical.dev.js:9212:1)
    at $parseSerializedNodeImpl (Lexical.dev.js:9230:1)
    at parseEditorState (Lexical.dev.js:9258:1)
    at LexicalEditor.parseEditorState (Lexical.dev.js:11518:1)
    at initializeEditor (LexicalComposer.dev.js:106:1)
    at LexicalComposer.dev.js:66:1
    at mountMemo (react-dom.development.js:17225:1)
    at Object.useMemo (react-dom.development.js:17670:1)
    at Object.useMemo (react.development.js:1650:1)
    at LexicalComposer (LexicalComposer.dev.js:46:1)
  • discord user avatar
    alessiogr
    last year

    hmhmm



    weird



    Can you open a github issue for this? Just so I can keep track of it - if it's no issue, I'll just close it. Not sure if I have time to investigate this today

  • default discord avatar
    kalon_robsonlast year

    Not a problem. I'll open it now

  • discord user avatar
    alessiogr
    last year

    ah



    wait I think I know what it could be



    If the editor saved some node in the past, and then it doesn't become available, it would error.



    It looks like you've added an upload node to the editor, saved, then removed the upload feature and opened it again



    Can you verify this happens to a completely empty editor?

  • default discord avatar
    kalon_robsonlast year

    I'm a dumbass, apologies, that's exactly what has happened.



    What makes the above worse, is I now recall doing this exact same thing in v1 but worked it out as such.

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..