satori
satori copied to clipboard
[Vercel OG] Failed to response when requesting multiple image at once
Bug report
Description / Observed Behavior
When requesting multiple images at once, say, an HTML page with multiple images, an error will be raised:
This invocation reused an I/O object (streams, request/response bodies, and others) created by a previous invocation, which is not permitted.
What makes this worse is that the empty response will be cached, so the same image can not be reproduced correctly in the next 24 hours.
Expected Behavior
Handling the generation right, even if the response time is longer.
Reproduction
See the example available at https://github.com/orgs/vercel/discussions/1437.
Additional Context
Tested with the latest @vercel/og 0.5.4 and can confirm the bug still exists. This is a duplicate of https://github.com/orgs/vercel/discussions/1437. Since there is less attention there, I am forwarding the issue here.
This is strange as Satori doesn't have external I/O unless you have <img src="...">. Not sure if it's related to the font or WASM file. Need to investigate it a bit.
This is strange as Satori doesn't have external I/O unless you have
<img src="...">. Not sure if it's related to the font or WASM file. Need to investigate it a bit.
I wanted to point out that according to @utkarshkukreti's workaround, the issue seems to be related to something that happened on edge, which can be avoided by switching to using satori in serverless function.
Hi @shuding! We actively use it in production to modify user images. Our team was wondering if there is any progress on the issue. We can also help to accelerate the fix and make it a bounty if you're open to it :)
hey @noskovvkirill !looks like @shuding is busy recently,but feel free to make a PR to make satori better!