the script will never generate a response.

I'm using next.js to serve images on my Cloudflare pages, but sometimes an error occurs with the img tag and the image doesn't display. Server side: the script will never generate a response. Client side: Error 1101 You've requested a page on a website (mysite.com) that is on the Cloudflare network. An unknown error occurred while rendering the page. Is there a solution?
10 Replies
$0
$0OP5mo ago
James
James5mo ago
are any errors logged when you look at log stream?
$0
$0OP5mo ago
Yes. It will be displayed in the cloudflare log. the script will never generate a response.
James
James5mo ago
Hmm, sounds very odd that it happens when you add img tags. Does it not happen when they aren't there?
$0
$0OP5mo ago
When I entered the URL directly in the browser, it was displayed. Even if I open an error request in the network tab of the browser's developer mode, it will be displayed. It is strange that it may also be displayed in the case of img tags. The cache header of cloudflare is dynamic. The browser cache is disabled.
James
James5mo ago
I feel like it's possible it could be related to how prisma is used
$0
$0OP5mo ago
I'm not good at English, but translate and read this site, you can expect that the reason why the image is not displayed is to access the image at the same time with multiple img tags. Thanks to you, I understood the cause. It was necessary to connect the DB for each request.
abc222
abc2224mo ago
Hello, I have a question about what you said here Do you mean that you had to call new PrismaClient({ adapter }) for each request ? Is it possible to keep a Prisma client between requests or not ?
$0
$0OP4mo ago
Do you mean that you had to call new PrismaClient({ adapter }) for each request ? >Yes.
Want results from more Discord servers?
Add your server