LexicalRichTextAdapter is not assignable to type 'RichTextAdapter<any, any>'

default discord avatar
bettrapp
last month
3

Trying out payload 2.0, but I'm running into the following type error in the payload.config.ts when adding the lexicalEditor.



Type 'LexicalRichTextAdapter' is not assignable to type 'RichTextAdapter<any, any>'.
  • discord user avatar
    dribbens
    Payload Team
    last month

    What version of lexical-editor is your project on?


    Can you share the import statement too?


    I have no idea just looking at this. It could be something @alessiogr knows about.

  • discord user avatar
    alessiogr
    Payload Team
    last month

    this used to be an issue when typescript strict mode is on. Should definitely be fixed in the latest version though

  • default discord avatar
    kepler97
    last month

    I encountered the same issue with strict mode enabled and had to do a type assertion as a workaround



    editor: lexicalEditor({}) as RichTextAdapter,
Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.