Files
cloudflare__vinext/examples/app-router-playground
James Anderson e40870e114 fix(og): lazy-load @vercel/og to keep it out of the main worker entry (#1774)
* fix(og): lazy-load @vercel/og to code-split it out of the worker entry

The next/og shim statically imported @vercel/og, so a top-level
`import { ImageResponse } from "next/og"` inlined ~800 KB of satori + resvg +
wasm/fonts into the always-loaded server entry. Import it via dynamic import()
inside the async stream callback so it is always a separate chunk.

app-router-cloudflare dist/server/index.js: ~1.67 MB -> ~875 KB.

* chore: drop changeset

* fix(og): copy resvg.wasm from split chunk + drop example workaround

Address review feedback on the lazy @vercel/og change:

- vinext:og-assets scanned only index.js for the resvg.wasm reference to
  decide whether to copy the Node.js disk-read fallback asset. Now that
  @vercel/og is code-split into its own chunk, that reference is no longer in
  index.js, so the copy was skipped (breaking the Node target's OG fallback).
  Scan all emitted chunks via the writeBundle bundle arg instead.
- app-router-playground used a manual `await import("next/og")` workaround
  that is no longer needed; switch it to the idiomatic static import.
2026-06-05 23:23:12 +01:00
..
2026-02-24 09:29:39 -06:00
2026-02-24 09:29:39 -06:00
2026-02-24 09:29:39 -06:00
2026-02-24 09:29:39 -06:00
2026-02-24 09:29:39 -06:00
2026-02-24 09:29:39 -06:00
2026-02-24 09:29:39 -06:00
2026-02-24 09:29:39 -06:00

Next.js Playground

This playground is used by the DX team to explore, test, and demo new Next.js features. It serves as a starting point for writing documentation and helps us understand features, identify bugs, and provide feedback to the Next.js team.

Running Locally

  1. Install dependencies:
pnpm install
  1. Start the dev server:
pnpm dev

Documentation

https://nextjs.org/docs