cloudflare / workers-sdk

⛅️ Home to Wrangler, the CLI for Cloudflare Workers®
https://developers.cloudflare.com/workers/
Apache License 2.0
2.41k stars 592 forks source link

🐛 BUG: `experimental:nodejs_compat_v2`Not Working Local or Deployment #6095

Open jjjrmy opened 1 week ago

jjjrmy commented 1 week ago

Which Cloudflare product(s) does this pertain to?

Pages

What version(s) of the tool(s) are you using?

3.61.0 [Wrangler]

What version of Node are you using?

18.18

What operating system and version are you using?

Mac Sonoma 14.5

Describe the Bug

I am able to deploy my Hono project onto Cloudflare Workers with node_compat = true. The same project won't work on Pages, I was told to use nodejs_compat_v2

Deployment ID: 3080aa6b-e5e7-43cf-a946-25209966bcd7

Observed behavior

The project will not upload the function, saying either experimental prefix is required or the flag doesn't exist at all. It's impossible to use.

When developing locally:

The `nodejs_compat_v2` compatibility flag is experimental and must be prefixed with `experimental:`. Use `experimental:nodejs_compat_v2` flag instead.

When deploying on Cloudflare:

Error: Failed to publish your Function. Got error: No such compatibility flag: experimental:nodejs_compat_v2

Expected behavior

It would be nice if my application would build and work same as Workers.

Steps to reproduce

Test locally or Deploy on pages using the flag experimental:nodejs_compat_v2

Please provide a link to a minimal reproduction

https://github.com/jjjrmy/hono-sutando-cf-worker-pages

Please provide any relevant error logs

No response

jjjrmy commented 7 hours ago
Error: Failed to publish your Function. Got error: No such compatibility flag: experimental:nodejs_compat_v2