Alternative to NodeHttpTransport in nice-grpc-web@3.0.0
Closed this issue · 5 comments
Hi,
First of all thanks for this great package!
I used previous versions to send grpc-web messages from nodejs. I could achieve this using NodeHttpTransport as transport, however it is not possible anymore as it is stated in the changelog.
Do you have any suggestion how I could have the same functionality in the new version?
Thanks
Hey,
Are you using NodeJS version older than 16?
nice-grpc-web
works with NodeJS 18 out of the box, and for NodeJS 16 it can be made to work with a few tweaks.
I am developing a VS Code extension, as far as I see VS Code uses NodeJS 16.14.2
I see. Unfortunately it is too old even for the undici fetch implementation.
NodeJS supports native fetch
since 16.15, not just 16+. I will update the docs. Even so, I don't think there's a way we could pass --experimental-fetch
flag to internal NodeJS of VS Code.
We need do add a new transport based on NodeJS http
/ https
modules.
Please try the new NodeHttpTransport
from 📦 nice-grpc-web@3.2.0
I tried it, it works perfectly. Thanks again for your help.