next-on-pages icon indicating copy to clipboard operation
next-on-pages copied to clipboard

[⚡ Feature]: Dev mode polyfill for cloudflare:sockets

Open n3oney opened this issue 2 years ago • 2 comments

Description

I use cloudflare:sockets to connect to my postgres database. It works fine in preview mode, however developing with it is pretty much impossible, due to the module not being available.

It'd be great if there was some kind of polyfill impl of cloudflare:sockets, so that it could be used in dev mode.

Additional Information

No response

Would you like to help?

  • [ ] Would you like to help implement this feature?

n3oney avatar Apr 07 '24 22:04 n3oney

@n3oney I think that this issue is not specific to next-on-pages but to any nodejs dev server that targets cloudflare (that might use getPlatformProxy for example) and I guess there would be more modules that would need to be polyfilled

Could you create a feature request issue in workers-sdk: https://github.com/cloudflare/workers-sdk/issues/new?assignees=&labels=enhancement&projects=&template=feature-request.yaml&title=%F0%9F%9A%80+Feature+Request%3A asking for such polyfills?

if we had them there then adding them to next-dev should be pretty straightforward 🙂

dario-piotrowicz avatar Apr 08 '24 11:04 dario-piotrowicz

https://github.com/cloudflare/workers-sdk/issues/5555

n3oney avatar Apr 08 '24 14:04 n3oney