Fixed
-
Fixed qpdf's wasm glue misdetecting the Cloudflare Workers runtime as Node.js when the
nodejs_compatcompatibility flag is enabled.The Emscripten-generated glue picks its code path via
globalThis.process?.versions?.node.nodejs_compatpolyfillsprocessfor compatibility with npm packages that expect it, which made the glue falsely take the Node.js branch. That branch callscreateRequire(import.meta.url), which throws in a bundled Worker since there's no realfile:URL to resolve — breaking every unlock/lock/merge/etc. call on Workers withnodejs_compaton (the majority of real-world Workers apps).Now detects the Workers runtime via
navigator.userAgent === 'Cloudflare-Workers'(stable regardless ofnodejs_compat, and never present in real Node.js) and hidesprocessonly for the duration of the one call that does the misdetection, restoring it immediately after. No API changes; real Node.js and browser usage are unaffected.