Configuration file for Pages projects does not support "node_compat"
I'm having some compatability issues, where my code works on Workers but not on Pages Functions.
20:24:18.122 ✘ [ERROR] Running configuration file validation for Pages:
20:24:18.122
20:24:18.123 - Configuration file for Pages projects does not support "node_compat"node_compat, but it does support nodejs_compat, which is slightly different5/29/24, 5:40 PM
knex is the package. and if they were the same thing, or functioned in the same way then node_compat flag would work the same as nodejs_compat0c8ad5d4-69f0-46d3-98fe-81e3922b1bc3Error: Failed to publish your Function. Got error: Uncaught Error: Dynamic require of "events" is not supportedevents is another nodejs api that isn't in workersnode_compat in wrangler + Workers being legacy, and doing weird things injecting node-specific APIs like events. If I would to guess, that's what happening here in Workers, but with Functions, node_compat isn't used, and therefore that events require isn't being stubbed, and then fails at runtime.nodejs_compat_v2 in compatibility_flags might work - I've not personally tested much with it yet, nor am certain if it includes events or not.node_compat vs nodejs_compat is pretty confusing, but node_compat is thankfully being phased out so over time this should become much easier, especially now with the introduction of nodejs_compat_v2 which does fundemantally a lot of the same things, but without all the build-time hacks.3080aa6b-e5e7-43cf-a946-25209966bcd7wrangler pages dev if you haven't already - it's going to be much faster for debuggingcompatibility_flags = ["experimental:nodejs_compat_v2"]node_compat. Pages doesn't support that intentionally, and almost certainly never willnode_compat=true, that's for the Workers deploymentnode_compatnode_compatnode_compatnode_compatnode_compatnode_compatnode_compatnodejs_compatnodejs_compatnodejs_compatknex0c8ad5d4-69f0-46d3-98fe-81e3922b1bc3Error: Failed to publish your Function. Got error: Uncaught Error: Dynamic require of "events" is not supportednodejs_compat_v2nodejs_compat_v2compatibility_flags3080aa6b-e5e7-43cf-a946-25209966bcd7The `nodejs_compat_v2` compatibility flag is experimental and must be prefixed with `experimental:`. Use `experimental:nodejs_compat_v2` flag instead.compatibility_flags = ["experimental:nodejs_compat_v2"]node_compat=true