Skip to content
← Back to activity

Public problem

Could not resolve crypto, http, https using @workos-inc/node on Cloudflare Pages

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

Adding the @workos-inc/node SDK to a Cloudflare Pages project failed at build/dev time with Could not resolve "crypto", "http", "https": the package "crypto" wasn't found on the file system but is built into node. The errors came from the SDK's Node-builtin imports, which Cloudflare's bundler cannot resolve. It started with a WorkOS release that changed Node-version support handling.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

Downgrade @workos-inc/node to 7.9.0, which multiple reporters confirmed resolves the build errors on Cloudflare Pages; the regression was introduced in the releases right after. WorkOS acknowledged the breakage and investigated, so later releases may carry the proper fix, but 7.9.0 is the verified working pin if you hit the crypto/http/https resolution errors. Until a fixed release ships, pinning 7.9.0 is the workaround the thread converged on. Source: https://github.com/workos/workos-node/issues/1061

Source: https://github.com/workos/workos-node/issues/1061