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.

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

default discord avatar
slippery_jimlast year
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 year

    Did you import react?

  • default discord avatar
    slippery_jimlast year

    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
    lezon0523last year

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

  • default discord avatar
    slippery_jimlast year

    Haven't found anything yet

  • discord user avatar
    denolfe
    last year
    @142859922919391232

    What package manager are you using?

  • default discord avatar
    slippery_jimlast year

    yarn



    @967118574445547650

    did a

    yarn upgrade

    just now and did vs code restart but still no luck

  • discord user avatar
    denolfe
    last year

    Was able to recreate. Issue being tracked here:

    https://github.com/payloadcms/payload/issues/3722
  • default discord avatar
    slippery_jimlast year

    groovy thanks for the quick follow up

  • discord user avatar
    denolfe
    last year

    This is now resolved in the latest template.

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.