Β© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developersβ€’7mo agoβ€’
1 reply
SkySolo I VanWild

Pages Function Fails: "Dynamic require" Error Despite nodejs_compat Flag

My Cloudflare Pages Function, which uses an Express server, is failing at runtime with the error: Uncaught Error: Dynamic require of "node:events" is not supported.

We have already taken the following troubleshooting steps:

Confirmed the nodejs_compat flag is in our wrangler.toml.

Confirmed the nodejs_compat flag is set correctly in the Pages project settings UI for both Production and Preview.

Completely deleted and recreated the Pages project from scratch, setting the flag during the initial setup wizard.

Despite these steps, the runtime environment is still not applying the compatibility flag. Please advise.
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

nodejs_compat Compatibility Flag for Nextjs (Cloudflare Pages)
Cloudflare DevelopersCDCloudflare Developers / general-help
17mo ago
`nodejs_compat` not working on cloudflare sites
Cloudflare DevelopersCDCloudflare Developers / general-help
9mo ago
nodejs version incompatible cloudflare pages cli
Cloudflare DevelopersCDCloudflare Developers / general-help
13mo ago
False Phishing Flag on Cloudflare Pages Portfolio
Cloudflare DevelopersCDCloudflare Developers / general-help
4mo ago