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.

Update Dependency

default discord avatar
lucbudolast year
38

when trying to access the admin panel i get this:

  • default discord avatar
    zed0547last year

    Hey

    @260382902976512000

    ,



    Yeah so payload v3 requires the pinned React RC version and next15, I'll link you here:

    https://github.com/payloadcms/payload/blob/main/templates/website/package.json#L48-L49

    Install those version of react and react-dom

  • default discord avatar
    lucbudolast year

    The exact one or what

    :meltingface:
  • default discord avatar
    zed0547last year

    Exact one my friend

  • default discord avatar
    lucbudolast year

    Ah thanks

    :niceone:
  • default discord avatar
    zed0547last year

    I'd clear node_modules, delete lockfile, pin your react version to above and reinstall



    Just to be safe

  • default discord avatar
    lucbudolast year

    K 👍 thanks man

  • default discord avatar
    zed0547last year

    My pleasure

  • default discord avatar
    engincannotlast year

    How do I specify the version with

    create-payload-app

    ? I tried to add it to my existing project with v18 but it's throwing the same error

  • default discord avatar
    zed0547last year

    It automatically installs in your project and tries to use the installed react, like I mentioned you need to have react v19, you can't specify it in the create-payload-app I don't believe



    To workaround this you need to install React 19 in your project, the pinned version I linked above

  • default discord avatar
    engincannotlast year

    That's a significant upgrade though...



    Will break many other things

  • default discord avatar
    zed0547last year

    If you cannot move to 19 in your project, then you have to run Payload standalone



    Outside of your next app as it's own project

  • default discord avatar
    engincannotlast year

    Do you recall when you moved to v19?



    Perhaps I can install older version of Payload

  • default discord avatar
    zed0547last year

    Hmm, it was a while ago, don't recall the exact beta version



    I think beta.117



    Oh no, even earlier

  • default discord avatar
    engincannotlast year

    Problem is I'm using a react component library which doesn't yet support v19



    Thanks

  • default discord avatar
    lucbudolast year

    are there maybe any templates i could download ?



    like next and payload already together

  • default discord avatar
    zed0547last year

    Website template here:

    https://github.com/payloadcms/payload/tree/main/templates/website

    I'd avoid the payload-demo repo as its not been updated



    Easiest way though,

    would

    be to

    npm create-payload-app@latest

    or

    pnpm dlx create-payload-app@latest
  • default discord avatar
    lucbudolast year

    yeah however it simply doesnt work with my setup even when setting it to the exact version u said



    and i want it to be integrated directly not standalone 😄

  • default discord avatar
    zed0547last year

    Did you remove node_modules and lockfile and reinstall with the correct version in package.json?



    And you're still getting the same error?

  • default discord avatar
    lucbudolast year

    i even setup a complete fresh install of next



    deleted the nodemodules and lockfile as u said

  • default discord avatar
    zed0547last year

    Never heard of the issue persisting after updating react version... if your error is the same then you don't have the required react versions



    Or you accidentally installed a second version of react



    You updated

    both

    react and react-dom?

  • default discord avatar
    lucbudolast year

    yes



    both

  • default discord avatar
    zed0547last year

    If you open a new clean folder, navigate to it and run the cli commands I pasted above it'll install the monorepo with Payload and Next in one

  • default discord avatar
    lucbudolast year

    Do the devdependencies play a role here too



    because for react dom and react it says ^18

  • default discord avatar
    zed0547last year

    In the template or in your project?



    And yeah absolutely

  • default discord avatar
    lucbudolast year

    in my project



    so they gotta be set at ^19 ?

  • default discord avatar
    zed0547last year

    Well, React and React-dom should really be in regular dependencies, I would wipe those from devdeps



    And reinstall



    And yeah, the version in the link I shared above

  • default discord avatar
    lucbudolast year

    So my steps atm are:


    1. Install new Next


    2. delete package-json.lock and node modules


    3. change the versions of react and react-dom


    4. npm i


    5. install payload

  • default discord avatar
    zed0547last year

    The npm i should already install payload for ya if you have it in package.json but essentially yeah

  • default discord avatar
    lucbudolast year

    "@types/react": "^18",


    "@types/react-dom": "^18",



    but these one refer to typescript or not ?

  • default discord avatar
    zed0547last year

    Those are for types, yeah for typescript



    If those are devedeps then you can change them to:

  • default discord avatar
    lucbudolast year

    "@types/react": "npm:types-react@19.0.0-rc.1",


    "@types/react-dom": "npm:types-react-dom@19.0.0-rc.1",



    i changed them to these

  • default discord avatar
    lucbudolast year

    ok so i created a new project using the website template u suggested



    it works



    however i dont need all this stuff

    :kekw:
  • default discord avatar
    zed0547last year

    There's also the blank template

  • default discord avatar
    lucbudolast year

    yeah but in the blank theres no nextjs



    oh no theres just no page.tsx etc



    can i just add that ?

  • default discord avatar
    zed0547last year

    Of course you can add it, you could use the website template as reference

  • default discord avatar
    lucbudolast year

    perfect now it works 😄



    thanks for the help

  • default discord avatar
    zed0547last year

    It's my pleasure! Glad you got it working

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.