You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting the following error on CloudFlare Workers:
{
"data": {
"message": "Cannot perform I/O on behalf of a different request. I/O objects (such as streams, request/response bodies, and others) created in the context of one request handler cannot be accessed from a different request's handler. This is a limitation of Cloudflare Workers which allows us to improve overall performance. (https://fonts.googleapis.com/css2?family=Inter:wght@400)",
"stack": "",
"statusCode": 500,
"statusMessage": "",
"url": "/api/og-image-font?name=Inter&weight=400"
},
"message": " (500 (/api/og-image-font?name=Inter&weight=400))",
"stack": "",
"statusCode": 500,
"statusMessage": "",
"url": "/api/og-image-svg?path=%2F"
}
Using the config:
ogImage: {// @todo this is broken in cloudflare workersfonts: ['Inter:400','Inter:700',{name: 'optieinstein',weight: 800,path: '/OPTIEinstein-Black.otf',}],},
I believe this workaround should be documented as a solution for the Cloudflare Workers issue. Or are there any drawbacks to using external fonts that I don't know?
harlan-zw
changed the title
Custom fonts and images broken with CloudFlare Workers
Custom images broken with CloudFlare Workers
Feb 1, 2024
Thanks for the details, the font issue should be solved with v3.0.0-rc.36
In this version we implement Nitro server storage for the fonts. The only issue with doing this is it's going to fetch the fonts on every request which is going to slow down the render.
Describe the bug
Getting the following error on CloudFlare Workers:
Using the config:
Reproduction
https://playground.harlanzw.workers.dev/api/og-image-svg?path=/
System / Nuxt Info
No response
The text was updated successfully, but these errors were encountered: