v0.10.1
Forme 0.10.1
Patch release fixing two regressions introduced in 0.10.0. No engine or rendering changes — existing PDFs render identically.
Fixed
Cloudflare Workers crash on import
@formepdf/core@0.10.0 called wasm.__wbindgen_start() at the top level of the bundler-target build. Wrangler passes import wasm from '*.wasm' back as { default: WebAssembly.Module } rather than an instantiated namespace, so this threw immediately:
TypeError: wasm.__wbindgen_start is not a function
Fixed by shipping a third build (--target web → pkg-web/) and a new dist/worker.js entry that takes an explicit init(wasmModule) call. The worker / edge-light / deno conditional exports now route here. Your 0.9.x pattern works again:
import { init, renderDocument } from '@formepdf/core'
import wasm from '@formepdf/core/pkg-web/forme_bg.wasm' // recommended
// or:
import wasm from '@formepdf/core/pkg/forme_bg.wasm' // legacy, also works
await init(wasm)Missing pkg-node/ in the published tarball
wasm-pack's --target nodejs output ships with a .gitignore containing *. npm publish honored it and silently dropped the entire directory. The 0.10.0 Node entry tried to import from ../pkg-node/forme.js, which wasn't there:
Cannot find module '../pkg-node/forme.js' from
'node_modules/@formepdf/core/dist/index.js'
Fixed by stripping .gitignore from all three pkg dirs during the WASM build, and adding a prepublishOnly assertion that re-packs the tarball and fails if anything required is missing.
VS Code extension build path mismatch
The bundled extension read ${__dirname}/forme_bg.wasm but the esbuild config still copied the WASM to the old pkg/ location. Now copies to dist/forme_bg.wasm. Only affected fresh 0.10.x rebuilds of the extension.
Added
@formepdf/core/workersubpath export@formepdf/core/pkg-web/forme.jsand@formepdf/core/pkg-web/forme_bg.wasmsubpath exportspackages/core/scripts/assert-tarball.sh— runs asprepublishOnlyand on every CI PR. Asserts every entry-point file is present in the tarball and that nopkgdir ships a stray.gitignore. Would have caught both regressions above at PR time.- Workerd smoke test (
@cloudflare/vitest-pool-workers) undernpm run test:workers. Runs inside real workerd, callsinit(wasm)+renderPdf(), and verifies the result has a%PDFheader. Catches the exact regression class that Node-based unit tests can't see.
Migration
You don't need to change anything. Existing 0.10.0 code works on 0.10.1.
If you're on Cloudflare Workers and were hitting the __wbindgen_start crash, upgrade to 0.10.1 — the import + init() pattern from 0.9.x is restored. pkg-web/forme_bg.wasm is recommended over pkg/forme_bg.wasm for new Workers code, but the legacy path still works.
Packages updated
| Package | Reason |
|---|---|
@formepdf/core |
The fix |
@formepdf/renderer, @formepdf/cli, @formepdf/hono, @formepdf/next, @formepdf/mcp, @formepdf/resend |
Updated to pull the core fix transitively |
@formepdf/react, @formepdf/sdk, @formepdf/tailwind, @formepdf/templates |
Version parity bump only — no code changes |
| VS Code extension | Build config fix for new core layout |
Not changed: Rust engine (same WASM bytecode across all three targets), Rust crate, Python SDK, Go SDK, Docker images, rasterizer — all still on 0.10.0.