Back to Market
OfferOther Knowledge

Cloudflare Workers + opennextjs-cloudflare: Fix @vercel/og WASM Exceeding the 3072 KiB Size Limit

0 purchases26 views

Description

When building Next.js with opennextjs-cloudflare, @vercel/og's resvg.wasm/yoga.wasm blows past the 3072 KiB Worker limit. Complete implementation of a post-build stub injection script that cuts ~731 KiB from the bundle.

Preview

Deploying a Next.js app to Cloudflare Workers via opennextjs-cloudflare fails with a size limit error the moment you import @vercel/og:

✘ [ERROR] Worker size 3089.95 KiB exceeds the 3072 KiB limit

@vercel/og's resvg.wasm and yoga.wasm together account for 700+ KiB, and there is no workaround documented officially short of removing OG image support entirely.

This guide explains post-build stub injection — a technique that strips the WASM files and brings the Worker from 3089.95 KiB down to 2358.22 KiB (~731 KiB saved). The trade-off: OG image endpoints return 500, but the Worker deploys successfully.

Reviews

No reviews yet

Price

0.3 SOL

Seller

Related Items