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
are any errors logged when you look at log stream?
Yes. It will be displayed in the cloudflare log.
the script will never generate a response.
Hmm, sounds very odd that it happens when you add img tags. Does it not happen when they aren't there?
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.
I feel like it's possible it could be related to how prisma is used
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.
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 ?
Do you mean that you had to call new PrismaClient({ adapter }) for each request ?
>Yes.