This is odd
What's the request look like
?
I've figured figured it to be something wrong with my lexical editor content in the
/route but cannot figure out what it is. All my other routes load fine, only when trying to load
/api/pagesand
/I get the error above
Payload v2?
const pages: Page[] = await fetch(`${process.env.NEXT_PUBLIC_SERVER_URL}/api/pages`, {
next: { revalidate: 300 },
})
.then(async (res) => {
return await res.json();
})
.then((res) => {
return res.docs;
});Yep
It was working before then my client told me about a slowdown on the site and I realised it was failing requests
const pages: Page[] = await fetch(`${process.env.NEXT_PUBLIC_SERVER_URL}/api/pages`, {
next: { revalidate: 300 },
})
const res = await res.json();
const docs = res.docsjust a lil cleanup
hmmm
Ah ok
Do you have access control on the pages?
funny thing is, it works fine locally, I set my db to be my payloadcloud db on my local instance and it works fine, no slow downs
Nope, none
Well - it is allowed to read
Can you check the requests in the network tab
and tell me the status
From which page?
Website is not loading at all now 😣
So
Whenever you get to a page, and it's broken, or you dont get data
Open your developer tools and check inspector
And click network, based on the failure status of the request, you can infer some things
This is the current state of it, but wasnt like this a week ago
images were loading fine
No issues there
How about your console errors
?
Hotjar, GTM and maps errors cos I have an adblocker
Oh im sorry, i mean your payload admin panel
Ohh
Basically, anywhere you notice an error
Lets try and check what happened there
Via checking the request
theres a PATCH when I save which gets resolved to 200 OK and a GET request that resolves as 304 not modified
I thought you said it errors when you request /api/pages
Yeah - so my home route
/is causing an error where it fails to load data for
/api/pagesand when requesting the data for slug that matches
/If you go to the payload document for the page
and click API
what's the URL
It seems to have fixed itself... I am not getting errors when saving or loading the API tab
this is also loading now
I'm not sure what happened to the content in the lexical editor, but something mustve messed up and it seems to be fixed now
I suspect it may have been caused by an image that was some how removed from the db and payload wasnt able to find it but it was referenced somehow. I reuploaded all of the images and it worked.. but not 100% sure. its confused me alot
Just waiting for a build to complete now fingers crossed
Its all fixed now. Thanks for the help!
Star
Discord
online
Get dedicated engineering support directly from the Payload team.