Closed codehz closed 12 months ago
Cloudflare supports some top level awaits (like crypto calls), but not all - you'll get 10021 Uncaught Error: Some functionality, such as asynchronous I/O, timeouts, and generating random values, can only be performed while handling a request.
Did you have a question? What I do normally is a one-time init in the scope of a request
Cloudflare supports some top level awaits (like crypto calls), but not all - you'll get
10021 Uncaught Error: Some functionality, such as asynchronous I/O, timeouts, and generating random values, can only be performed while handling a request.
Did you have a question? What I do normally is a one-time init in the scope of a request
ok I found the problem is the code is trying to instantiate a wasm module, it is not support anyway (cf require to use binding), I modified the code to not use wasm, and the problem is solved
some dependencies use top level await, which isn't supported in cloudflare worker, I with it can provide transpile support for it