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.

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

default discord avatar
iaremarkuslast year
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
    nclevengerlast year
    @168024524393152512

    did you need to set

    credentials: 'include'

    on your

    fetch

    ?

  • default discord avatar
    iaremarkuslast year

    not after setting read to true, no



    essentially makes it public, which is what i was after

  • default discord avatar
    nclevengerlast year

    ok

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.