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
Uncaught Error: Disallowed operation called within global scope. Asynchronous I/O (ex: fetch() or connect()), setting a timeout, and generating random values are not allowed within global scope. To fix this error, perform this operation within a handler. https://developers.cloudflare.com/workers/runtime-apis/handlers/
at null.<anonymous> (index.js:972:51) in _startAutoCleanup
at null.<anonymous> (index.js:899:18) in Group
at null.<anonymous> (index.js:6834:19) in createGroups
at null.<anonymous> (index.js:6880:5) in throttling
at null.<anonymous> (index.js:4126:54) in Octokit
at null.<anonymous> (index.js:4024:9) in OctokitWithDefaults
at null.<anonymous> (index.js:9866:14)
Workaround
import{env}from"cloudflare:workers";import{Octokit}from"octokit";// exclude the "throttling" plugin.// see https://github.com/octokit/plugin-throttling.js/issues/794Octokit.plugins=Octokit.plugins.filter((plugin)=>plugin.name!=="throttling");exportconstgithub=newOctokit({auth: env.GITHUB_TOKEN,});
The text was updated successfully, but these errors were encountered:
From what I've gathered from the very sub-optimal minimal stack trace information, it's not an issue with Octokit directly but one with the Bottleneck dependency which is unmaintained
using Octokit on Cloudflare Workers while importing bindings globally errors.
with the following error:
Workaround
The text was updated successfully, but these errors were encountered: