`Something went wrong` when doing a `fetch` on certain endpoints

default discord avatar
iaremarkus
last month
3

👋



I can't work out why certain endpoints like

globals/settings

and

media

return data no problem, but others like

pages

or a custom

testimonials

one return a rather unhelpful

Something went wrong

error.



When browsing directly to these endpoints, they are fine. But when querying them from a NextJS project, they dont work..



Has anyone experienced this?



my access was set to

read: adminsOrPublished

which would make me think that its readable by admins, or when published?



but seems

fetch

is only able to get it when its set to

read: () => true
  • default discord avatar
    nclevenger
    last month

    @iaremarkus did you need to set

    credentials: 'include'

    on your

    fetch

    ?

  • default discord avatar
    iaremarkus
    last month

    not after setting read to true, no



    essentially makes it public, which is what i was after

  • default discord avatar
    nclevenger
    last month

    ok

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.