Im trying to run GRPC from inside a service worker. It works fine from inside the main application thread and only throws an error from inside a service worker.
typescript
const media = new MediaServiceClient(process.env.VUE_APP_GRPC)
media.index(pagination, headers)
Error:
Uncaught (in promise) TypeError: e.serializeBinary is not a function
Im assuming this is due to how GRPC communicates to the backend services and assuming this is not possible to do at the moment?
Thanks
same problem here
We have a patch in google-closure to support service workers (via fetch) and will try to get the change to github soon.
@wenbozhu has this been resolved yet?
@travikk if it's any use to hear, we've been using grpc-web in web workers without a problem.
@travikk if it's any use to hear, we've been using grpc-web in web workers without a problem.
How so? The generated code references window object which is not available in web worker. @markns
Most helpful comment
We have a patch in google-closure to support service workers (via fetch) and will try to get the change to github soon.