Nodejs_compat Flag Missing in Pages UI for Next.js Project

For Workers & Pages, what is the name of the domain?

attribution-dash-test.pages.dev

What is the issue or error you’re encountering

After deploying my Next.js application (which uses dependencies requiring Node.js APIs, like Supabase SSR for middleware), I receive the following runtime error when visiting the site: Node.JS Compatibility Error no nodejs_compat compatibility flag set. The core problem is that the nodejs_compat compatibility flag is not visible or selectable in my Pages project settings under Settings → Functions → Compatibility Flags. The only related flags I see are nodejs_compat_populate_process_env and nodejs_compat_do_not_populate_process_env.

What steps have you taken to resolve the issue?

  1. Enabled Next.js Preset: Confirmed the “Next.js” framework preset is selected in the Pages project settings. This correctly sets the build command (npx @cloudflare/next-on-pages@1) and output directory (.vercel/output/static).

  2. Set Compatibility Date: Set a recent Compatibility Date (April 28th, 2025) under Settings → Functions → Compatibility Date.

  3. Checked UI Repeatedly: Double- and triple-checked the Settings → Functions → Compatibility Flags section in the dashboard UI. The nodejs_compat flag is definitely not listed as an option to enable.

  4. Attempted wrangler.toml: Created a wrangler.toml file in the project’s root directory (/dashboard) containing name = “attribution-dash-test”, compatibility_date = “2024-10-01”, and compatibility_flags = [ “nodejs_compat” ].

  5. wrangler.toml Ignored: The Pages build log showed this file was found but ignored because it wasn’t considered a valid Pages configuration file (A wrangler.toml file was found but it does not appear to be valid… Skipping file and continuing.). The nodejs_compat flag was therefore not applied.

  6. Removed wrangler.toml: Deleted the wrangler.toml file and redeployed to avoid confusion, confirming the error still persists without it.

My Question:

How can I enable the required nodejs_compat flag for my Cloudflare Pages project when it is not appearing as an option in the dashboard UI under Compatibility Flags? Is there an alternative method, a known UI issue, or something else I might be missing?

Thanks for any assistance!

That sounds a lot like this topic:

Wow… i have been at this for a while and might have gone a little mad… rather than typing and just selecting what i typed then clicking save i was hitting enter after typing and it would pick one of the other compat options leaving me to pull my hair out. My face is red, thanks for pointing me in the right direction!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.