Various components "cannot be used as a JSX component."

default discord avatar
slippery_jim
last month
9

I saw someone else posted a similar question but it seems to be deleted.


This is using the website template. It's not a "real" error because the site runs, but I can't get VS code to accept it. I've tried restarting it and the other usual VS code highlight fixes but no luck.



Payload 2.0.4 w/ yarn using the website template



same issue different error

  • default discord avatar
    copypaper.
    last month

    Did you import react?

  • default discord avatar
    slippery_jim
    last month

    I didn’t change any code. It’s not an import issue as the site runs fine, it only happens in VS code. I'm using the website template without any modification

  • default discord avatar
    lezon0523
    last month

    I got this issue too, do you find any solution?

  • default discord avatar
    slippery_jim
    last month

    Haven't found anything yet

  • discord user avatar
    denolfe
    Payload Team
    last month

    @slippery_jim What package manager are you using?

  • default discord avatar
    slippery_jim
    last month

    yarn



    @denolfe



    did a

    yarn upgrade

    just now and did vs code restart but still no luck

  • discord user avatar
    denolfe
    Payload Team
    last month

    Was able to recreate. Issue being tracked here:

    https://github.com/payloadcms/payload/issues/3722
  • default discord avatar
    slippery_jim
    last month

    groovy thanks for the quick follow up

  • discord user avatar
    denolfe
    Payload Team
    last month

    This is now resolved in the latest template.

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.