next-on-pages: [🐛 Bug]: `@vercel/og` doesn't work

I’m having issues getting my project to successfully deploy on Cloudflare because I am relying on a dependency (@vercel/og) which uses satori/wasm.

The Vercel building process goes fine but when next-on-pages gets to build the final worker bundle , esbuild fails with error:

✘ [ERROR] Could not resolve "/wasm/wasm_53adb396180a95eb122a0218c93e3d6474b1a27e.wasm"

Any idea on how this could get resolved?

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 22 (12 by maintainers)

Most upvoted comments

@lucaswalter I’ve merged the PR so @vercel/og should now work 🙂

See the example I added in the PR’s description: https://a9aeda25.next-on-pages-test-5h3.pages.dev/

As you can see (third link) now @vercel/og should work, unfortunately it seems like in certain cases we can get an error (second link), I believe that that is a runtime bug and I will check with the runtime team about it, so let’s keep this issue open a bit longer, so I will let you know here when that is also sorted out

(PS: you can check in the latest beta release if @vercel/og works for your use case)

I’m sure they did work. I hope you are able to find the cause, I’ll be around to run any tests you might need help with.

For whatever reason the custom font example on your site DOES work (im assuming old deployment/version) https://17cb6ed0.next-apps-for-testing.pages.dev/api/og-custom

I’ll open a new issue, hopefully I’ll get a minimal example ready by tomorrow

This is awesome, thank you!

Ps the second link on the deployment you shared @dario-piotrowicz is not working “Example of vercel/og usage (which relies on wasm)” returns “internal server error” for me

@tomaspietravallo Thanks a bunch for letting me know 🙏 (PS: when I wrote my comment above with all those deployments all of them worked fine including the one you shared… now I also go get the internal server errors 😓)

This issue is quite bothersome as it has to be something runtime related… and it looks like the issue appears and disappears… making it very difficult to understand what’s going wrong! 😓 I’ll have to try to see if anything can be done regarding it 😓

Thanks @dario-piotrowicz — Will keep following along

No problem @lucaswalter 🙂

Check out #325 we’re very close! 😄 (feel free to try out the next-on-pages prerelease and let me know if it works for you if you want)

@lucaswalter as far I know there actually isn’t a real blocker, it’s just a matter of finding the time to dig into what the issue with vercel/og actually is.

it’s been a few weeks so I don’t remember precisely, but I think there was something Vercel does that we need to reverse engineer and fix/adapt to our runtime.

Sorry, I haven’t put too much priority into this since being related to a Vercel library so it’s not a core issue with Next per se, I’ll try to dig into this soon (this or next week) 🙇

PS: I’ll post status updates here