Skip to content

# Bug: "Disallowed operation called within global scope" error in v2.0.41 #4034

@melihakyol06

Description

@melihakyol06

Bug: "Disallowed operation called within global scope" error in v2.0.41

Description

After upgrading from @rivetkit/[email protected] to @rivetkit/[email protected], the dev server fails to start with the error:

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/workersruntime-apis/handlers/

Environment

  • @rivetkit/cloudflare-workers: 2.0.41 (broken), 2.0.33 (works)
  • rivetkit: 2.0.41
  • wrangler: 4.60.0
  • Platform: Cloudflare Workers

Steps to Reproduce

  1. Create a Cloudflare Workers project with RivetKit
  2. Use @rivetkit/[email protected]
  3. Run dev server
  4. Error occurs immediately

Workaround

Downgrade to version 2.0.33.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions