-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsupported image type: unknown
in production only
#626
Comments
same issus on my prod env, wtf |
I had the same error. It seems Vercel server returns a 403 error when fetching an image url with plain async function fetchImageAsBase64(url: string): Promise<string> {
const response = await fetch(url, {
headers: {
'User-Agent':
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
},
cache: 'force-cache',
});
const arrayBuffer = await response.arrayBuffer();
const base64 = Buffer.from(arrayBuffer).toString('base64');
const type = response.headers.get('content-type');
return `data:${type || 'image/png'};base64,${base64}`;
} |
@devrsi0n It did not work for me |
You need to check if the server is returning a valid image response, if it's not, Satori can't do anything for you. |
Bug report
Description / Observed Behavior
Encountering intermittent issues with Satori in production when generating open-graph cards. Errors logged in Sentry indicate problems with image loading:
Unsupported image type: unknown
Error: Image size cannot be determined. Please provide the width and height of the image.
Despite these errors, the image URL functions as expected when accessed directly. The issue does not occur in local environments or consistently in production, making it challenging to reproduce.
Expected Behavior
Satori should load and process the images without errors, consistently generating the open-graph cards with the provided images from Cloudinary.
Reproduction
Unable to reproduce the issue locally or intentionally in production—the issue is intermittently throwing and only production environment.
Here is an example URL where the error has been thrown:
http://contra.com/@internal/open-graph-card/user/blesscreatics
Additional Context
The text was updated successfully, but these errors were encountered: