payload__WEBPACK_IMPORTED_MODULE_2__.default.find is not a function

default discord avatar
fpnv_7133611 months ago

Hello Payload community!


I am trying to use the payload local api inside of a react function component.

My component is inserted BeforeDashboard.

It seems the payload.init({...}) is not fully done whern the component gets called, and so payload is not properly initialized, resulting in this error :

Uncaught (in promise) TypeError: payload


.default.find is not a function

Is there maybe another way to do what I'm trying to do?


  • discord user avatar
    11 months ago

    You cannot use the local API inside of a react component. The local API is server side only, so unless you are using something like server components, then you will need to use REST or GraphQL to interact with your data 👍

  • default discord avatar
    fpnv_7133611 months ago

    That does indeed explain everything!

Star on GitHub


Chat on Discord



Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.