For Workers & Pages, what is the name of the domain?
What is the error message?
Uncaught ReferenceError: process is not defined at functionsWorker-0.5076308457381207.js:142:28
What is the issue or error you’re encountering
Cloudflare Pages Functions deployment fails with process is not defined
, even though process is never referenced in my code. My Functions compile and deploy, but the error occurs at runtime in the final bundled output.
What steps have you taken to resolve the issue?
- Removed all usage of
process.env
,btoa
,Buffer
, and Node-related syntax - Rewrote JWT generation using Web APIs (
crypto.subtle
,TextEncoder
) - Replaced all emojis and non-ASCII characters in code and output
- Verified no third-party modules or Node imports are being used
- Confirmed environment variables are accessed via
context.env
- Added minimal
wrangler.toml
with compatibility_date and pages_build_output_dir - Cleaned all files and re-ran builds
What are the steps to reproduce the issue?
- Deploy a Cloudflare Pages project with serverless Functions using Web APIs for JWT signing
- Use
crypto.subtle.importKey()
andsubtle.sign()
with a service account key - Functions compile and upload successfully
- Deployment fails with
Uncaught ReferenceError: process is not defined
from inside the generatedfunctionsWorker-xxxx.js
file