workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

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

Open jjjrmy opened this issue 1 year ago • 8 comments

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 avatar Jun 19 '24 18:06 jjjrmy