cuid icon indicating copy to clipboard operation
cuid copied to clipboard

version 3 breaks on cloudflare workers: 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.

Open capaj opened this issue 1 month ago • 1 comments

https://github.com/capaj/faktorio/actions/runs/19192226702/job/54868243201

  ✘ [ERROR] A request to the Cloudflare API (/accounts/***/workers/scripts/faktorio-api/versions) failed.
  
    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> (file:///home/runner/work/faktorio/faktorio/node_modules/.pnpm/@[email protected]/node_modules/@paralleldrive/cuid2/src/index.js:23:25)
      at null.<anonymous> (file:///home/runner/work/faktorio/faktorio/node_modules/.pnpm/@[email protected]/node_modules/@paralleldrive/cuid2/src/index.js:107:38) in init
      at null.<anonymous> (file:///home/runner/work/faktorio/faktorio/node_modules/.pnpm/@[email protected]/node_modules/@paralleldrive/cuid2/src/index.js:134:18)
     [code: 10021]
    To learn more about this error, visit: https://developers.cloudflare.com/workers/observability/errors/#validation-errors-10021

capaj avatar Nov 08 '25 11:11 capaj

also when you do this on tanstack start, CF logs give you 0 info about what is actually causing the problem

https://discord.com/channels/719702312431386674/1437536318195372193/1437536318195372193

capaj avatar Nov 11 '25 03:11 capaj