Strange hooks error

default discord avatar
kobeaerts
7 months ago
14

I'm starting with payload and everything works but now suddenly I'm getting this weird React Hooks error. 😦



I've attached my config files over here:

https://gist.github.com/kobeaerts/cd40e51224f9821b3ea06c3858f39a65

Any ideas?

  • discord user avatar
    alessiogr
    Payload Team
    7 months ago

    What build tool are you using? If it's yarn, can you run

    yarn why react

    ?

  • default discord avatar
    kobeaerts
    7 months ago
    C▲ Sites/dcide-payload  yarn why react
    yarn why v1.22.15
    [1/4] 🤔  Why do we have the module "react"...?
    [2/4] 🚚  Initialising dependency graph...
    [3/4] 🔍  Finding dependency...
    [4/4] 🚡  Calculating file sizes...
    => Found "react@18.2.0"
    info Reasons this module exists
       - "payload" depends on it
       - Hoisted from "payload#react"
    info Disk size without dependencies: "320KB"
    info Disk size with unique dependencies: "352KB"
    info Disk size with transitive dependencies: "380KB"
    info Number of shared dependencies: 2
    ✨  Done in 0.67s.
    ▲ Sites/dcide-payload  

    `



    Ok, I deleted all my lock files and ran a new fresh install, that fixed it 😐

  • default discord avatar
    pooledge
    7 months ago

    It didn't for me, using

    npm
  • default discord avatar
    kobeaerts
    7 months ago

    Well fuck me, it's back 😄

  • default discord avatar
    cbregante
    7 months ago

    i have same error after install @aws-sdk/client-s3 and @aws-sdk/lib-storage


    but i cannot solve 😒

  • default discord avatar
    pooledge
    7 months ago

    i ve summoned a new payload app in a different dir and it seems to work now



    so i guess it's not about react after all (sorry)



    as soon as I do

    npm i

    or

    npm update

    bahbye



    so as soon as any installation process apart from the scaffolding

    create-payload-app

    is involved it stops working



    ok I was able to mitigate this issue after installing latest

    react

    and

    react-dom

    as dev dependencies

  • default discord avatar
    edubasabe
    6 months ago

    Adding this to my package.json has fixed this error.


      "overrides": {
        "react": "18.2.0"
      }
  • discord user avatar
    dribbens
    Payload Team
    6 months ago

    We have some changes in a canary release that should address the react dependencies problems.


    You can wait for the release (probably tomorrow) or if you want to try the canary, pin your version in package.json to dependency

    "payload": "1.8.3-canary.1" The changes make it so you don't need

    overrides

    or

    resolutions

    or

    --legacy-peer-deps`

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.