You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Ably in Cloudflare Workers, the following errors are shown when Ably.Rest.auth.createTokenRequest or Ably.Rest.auth.requestToken is called. These don't happen in pure WebWorker environments and only in Cloudflare Workers. There was a separate issue for WebWorkers being resolved by this PR.
The error seems to be caused by calling Http.Request in line 136 of browser/lib/util/https.js. However, why it only happens in Cloudflare Workers (and not Web Workers in general), I don't know. I personally am not blocked by this bug/ issue because I stopped using Cloudflare Workers because the debugging experience was not good. Firebase functions can be debugged with breakpoints in WebStorm, and it's been great. Though it might be good to support users who wish to use Ably on Cloudflare Workers.
Reproducing it
Create a free cloudflare account if you don't have one. You don't need to do anything else, you automatically get given a workers.dev domain: e.g. abcd.workers.dev. You can change it if you want.
Notice the error shown above in the terminal output
A small bit of detail about Cloudflare Workers
It configures webpack target to be webworker, but it also uses the Service Worker APIs to incept network requests/ act as a server/ serverless function. The reason they do this instead of running NodeJS is cost, performance and scalability. There is no cold start issue like normal serverless, much lower memory footprint. More about that here. So perhaps it is because we do not support running in "service worker", though this is just a guess.
When using Ably in Cloudflare Workers, the following errors are shown when
Ably.Rest.auth.createTokenRequest
orAbly.Rest.auth.requestToken
is called. These don't happen in pure WebWorker environments and only in Cloudflare Workers. There was a separate issue for WebWorkers being resolved by this PR.The error seems to be caused by calling
Http.Request
in line 136 ofbrowser/lib/util/https.js
. However, why it only happens in Cloudflare Workers (and not Web Workers in general), I don't know. I personally am not blocked by this bug/ issue because I stopped using Cloudflare Workers because the debugging experience was not good. Firebase functions can be debugged with breakpoints in WebStorm, and it's been great. Though it might be good to support users who wish to use Ably on Cloudflare Workers.Reproducing it
abcd.workers.dev
. You can change it if you want.A small bit of detail about Cloudflare Workers
It configures webpack target to be webworker, but it also uses the Service Worker APIs to incept network requests/ act as a server/ serverless function. The reason they do this instead of running NodeJS is cost, performance and scalability. There is no cold start issue like normal serverless, much lower memory footprint. More about that here. So perhaps it is because we do not support running in "service worker", though this is just a guess.
┆Issue is synchronized with this Jira Uncategorised by Unito
The text was updated successfully, but these errors were encountered: