-
Notifications
You must be signed in to change notification settings - Fork 70
Open
Description
Description
Hi there, thank you for the good work. During some maintenance update I discovered @paralleldrive/cuid2, starting from 3.0.1, cause crash in my production build, targeted Cloudflare worker environment, using their official vite-plugin. The server log is as follow, although it is not very helpful:
✘ [ERROR] service core:user:cloudflare-vite-get-started: 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/
Reproduction
Please see https://github.com/vnphanquang/cloudflare-worker-vite-plugin-cuid2 and its README for detailed steps to reproduce. I did not test if this causes similar issue without the vite-plugin (running wrangler directly).
I suspect this is due to some ESM syntax introduced recently, or some imported module with side effects. But since there is no entry for 3.0.1 in the CHANGELOG, I'm not able to investigate further at this point, sorry.
sbekrin, Jastor11, firxworx, cloudkite, msickpaler and 7 moreconvcha, carlosalbertolajr, msickpaler and LeonHeidelbach
Metadata
Metadata
Assignees
Labels
No labels