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.

Failed to load resource

default discord avatar
banankiemlast year
2

Hello Dear Community! 💪



Env:


- Next + Payload, 0.1.9


- Next, 13.5.6


- Payload, 2.0.15




Local dev: ✅


Local prod: ✅


Vercel dev: ❎


Vercel prod: ❎



✅ - working, ❎ - not working



As a team we are struggling with an issue on host. We are getting an issue with Payload api connection, and there is no chance to catch a connection with:


- /api/users/me


- /api/users/init


- /api/payload-preferences/nav


Since two days we start getting 504 Gateway Timeout, before there was a one time situation with similar issue, but it repaired for ever after few refreshes. 😄



All the cache is cleared, there were no changes inside payloadClient and config or next withPayload files, and all env variables are correct (nothing changed since last working version of our prod). 🙈



Let me know if I should provide you with configs, or something is needed. 🙏



Thanks in advance! ❤️

  • default discord avatar
    y0backlast year

    I had the same issue not that long ago. I was using Serverless Next.js + Serverless Mongo + Serverless Payload. I was struggling to find any logs in any of these tools and I had to abort this project pretty soon :/


    Treat this as an upvote for this thread as I really hope that this issue will be resolved 🙂



    PS. For me the whole /api was not working. All other pages were generating correctly with data from payload(mongo). I was getting 504 on all of these requests, which was weird as I was expecting 404 or something like that. Request were taking like 15s+ up until they were aborted by Vercel(serverless function timeout)

  • default discord avatar
    banankiemlast year

    Hey

    @939485739786338365

    , thanks for your input ❤️



    I've already resolved this by adding this code to the vercel.json 🙂 Our project is too big (2k+ pages), there are too many components, and collections, so the loading time probably is too long - idk. 😄



    "functions": {
        // path to all api's from PayloadCMS
        "src/pages/api/**/*.{js,ts}": {
          "maxDuration": 300
        },
        // path to own api's, e.g. revalidate
        "src/app/api/**/*.{js,ts}": {
          "maxDuration": 300
        },
        // path to the pages with [...slug]
        "src/app/(site)/**/*.{tsx}": {
          "maxDuration": 300
        }
      }


    I hope this will help you too. ❤️



    Forget to mention that, you need to be on min. PRO plan on Vercel :/


    I believe that setting up PayloadCMS next to your frontend is better at this point.

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.