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_jim2 years ago
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.2 years ago

    Did you import react?

  • default discord avatar
    slippery_jim2 years ago

    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
    lezon05232 years ago

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

  • default discord avatar
    slippery_jim2 years ago

    Haven't found anything yet

  • discord user avatar
    denolfe
    2 years ago
    @142859922919391232

    What package manager are you using?

  • default discord avatar
    slippery_jim2 years ago

    yarn



    @967118574445547650

    did a

    yarn upgrade

    just now and did vs code restart but still no luck

  • discord user avatar
    denolfe
    2 years ago

    Was able to recreate. Issue being tracked here:

    https://github.com/payloadcms/payload/issues/3722
  • default discord avatar
    slippery_jim2 years ago

    groovy thanks for the quick follow up

  • discord user avatar
    denolfe
    2 years ago

    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.