No such module "node:events"

I started seeing this error today:

✘ [ERROR] Error on remote worker: APIError: A request to the Cloudflare API (/accounts/.../workers/scripts/just-worker/edge-preview) failed.

      at throwFetchError
  (/Users/.../workspace/just-worker/node_modules/wrangler/wrangler-dist/cli.js:155221:18)
      at fetchResult
  (/Users/.../workspace/just-worker/node_modules/wrangler/wrangler-dist/cli.js:155134:5)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async createPreviewToken
  (/Users/.../workspace/just-worker/node_modules/wrangler/wrangler-dist/cli.js:204470:29)
      at async createWorkerPreview
  (/Users/.../workspace/just-worker/node_modules/wrangler/wrangler-dist/cli.js:204491:17)
      at async start
  (/Users/.../workspace/just-worker/node_modules/wrangler/wrangler-dist/cli.js:205214:34) {
    text: 'A request to the Cloudflare API
  (/accounts/.../workers/scripts/just-worker/edge-preview) failed.',
    notes: [
      {
        text: 'Uncaught Error: No such module "node:events".\n' +
          '  imported from "index.js"\n' +
          ' [code: 10021]'
      }
    ],
    location: undefined,
    kind: 'error',
    code: 10021
  }


I didn't make any changes that I think would cause this.

I tried upgrading my wrangler to the latest version & i already have the node compatibility flag set.
Was this page helpful?