# Dynamic require of buffer/index.js is not supported with nodejs_compat (WorkOS on Cloudflare)

## The problem

Enabling the nodejs_compat compatibility flag in wrangler.jsonc with @workos-inc/node 7.59.0 failed at runtime with Error: Dynamic require of "buffer/index.js" is not supported, thrown from iron-webcrypto's bundled code. The SDK's crypto dependency used a dynamic require pattern that Cloudflare Workers (via vite) cannot handle. The failure was specific to the nodejs_compat path; without the flag the SDK loaded normally.

## The verified fix

Fixed in the v8 release of @workos-inc/node (PR #1370 reworked the crypto handling). Upgrade to v8 or newer if you run on Cloudflare Workers with nodejs_compat. On 7.x there is no clean fix; the error only appears in the local miniflare/vite dev path for some setups, so upgrading to v8 is the supported resolution.
Source: https://github.com/workos/workos-node/issues/1306