Serverless / Vercel
Nebula targets Node.js servers. It depends on native addons:
sharp@resvg/resvg-js
Those packages do not run in the browser or typical Edge/WASM runtimes.
Practical checklist
Section titled “Practical checklist”- Use a Node.js runtime (e.g. Vercel Node serverless functions / App Router
runtime = 'nodejs'). - Bundle or include platform-correct native binaries for your deploy OS/arch (Linux x64 is common on Vercel).
- Watch memory and timeout — large tables and high
devicePixelRatioincrease PNG size and work. - Prefer embedding fonts as Buffers loaded at cold start (or from the function bundle), not from remote URLs on every request.
- Keep
devicePixelRatioat1or2for colder / smaller functions.
Vercel App Router sketch
Section titled “Vercel App Router sketch”export const runtime = 'nodejs';export const maxDuration = 30;
// Same pattern as Next.js: engine.generate → Response(pdf, { headers })What not to expect
Section titled “What not to expect”- Edge Middleware / Edge Functions
- Cloudflare Workers without a Node-compatible native strategy
- Bundlephobia-style “browser bundle size” metrics (native deps cannot be browser-bundled)