Open Graph Image Generation Error [My fault] #65771
-
SummaryFirst of all, I don't have much experience using Next.js. Mostly I have wrote code for backends so there may be newbie issues or skill issues existing. For anyone who wants TL;DR: on this snippet, if there are no img tags exists in What happenedI wanted to create my own Open Graph Image Generator using this example. I have one of my acquaintance to help me with it. It was all good when suddenly the browser reload icon circles endlessly and the dev server is not responding. There was no error logs or anything. When it occur, the other routes which are not related with the page also keep reloading. What I have tried
Code + workaround?The snippet of the code can found here, full index file can be found here. As a small workaround(...?), if there's "any" img tag exists in the Full source code is available on here. If there's any information need, please let me know. Additional information`bun run next info`:
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Education
Available memory (MB): 32621
Available CPU cores: 20
Binaries:
Node: 22.1.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant Packages:
next: 14.3.0-canary.59 // There is a newer canary version (14.3.0-canary.63) available, please upgrade!
eslint-config-next: N/A
react: 18.3.1
react-dom: 18.3.1
typescript: 4.9.5
Next.js Config:
output: N/A
⚠ There is a newer canary version (14.3.0-canary.63) available, please upgrade!
Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
Read more - https://nextjs.org/docs/messages/opening-an-issue
(Since I was using latest version of next, I tried to use canary if it was solved. But it didn't helped.) Example |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
IIRC, vercel/og uses https://github.com/vercel/satori under the hood, and this is looking more like a problem with that library rather than Next.js I am a bit confused, you have a body tag, and h1 and such, but the ImageResponse library serves an image, rather than HTML... So the reason why it "hangs", is that, the HTML you are passing to Satori, to generate an img, not html, is causing some issues with their internal rendering. Note that they don't support the full spec of HTML+CSS. |
Beta Was this translation helpful? Give feedback.
IIRC, vercel/og uses https://github.com/vercel/satori under the hood, and this is looking more like a problem with that library rather than Next.js
I am a bit confused, you have a body tag, and h1 and such, but the ImageResponse library serves an image, rather than HTML...
So the reason why it "hangs", is that, the HTML you are passing to Satori, to generate an img, not html, is causing some issues with their internal rendering. Note that they don't support the full spec of HTML+CSS.