Failed to load resource

default discord avatar
banankiem
2 weeks ago
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
    y0back
    2 weeks ago

    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
    banankiem
    2 weeks ago

    Hey @y0back, 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.

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.