Skip to content

Conversation

@robertlong
Copy link
Contributor

I was having the same bug described in #134 and traced it to this line.

Still trying to wrap my head around why this.fetch cannot be invoked when the wrapping closure is called inside withAutomaticRetries. And why does this only happen in cloudflare workers? Saving the fetch method to a temporary variable seems to work though.

Fixes #134

Copy link
Contributor

@mattt mattt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robertlong Thanks so much for sharing this fix! I'm also confused about why this is necessary. "Cloudflare Workers uses the V8 JavaScript engine", but something in their runtime seems to cause JavaScript context to behave differently.

Whatever the reason, I'm happy the fix you've found is small and unlikely to cause issues with other environments.

@mattt mattt merged commit e230496 into replicate:main Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: Illegal invocation | Cloudflare workers

2 participants