You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nitro 2.8.0
Nodejs: 20 (on my windows 11), but, in production, using Cloudflare pages preset while building my app.
Reproduction
Using useEvent() directly instead of explicitly passing in event gives this error: 500 Nitro request context is not available. Note: This is an experimental feature and might be broken on non-Node.js environments.
Describe the bug
Of course, Cloudflare is not node environment, so the error is logical and clearly states this. But, is there any way can we have this feature in non-node environment? I mean is it actually possible? Else I will simply have to keep passing event in each function in the utils folder. Thanks.
pi0
changed the title
Error 500 Nitro request context is not available. Note: This is an experimental feature and might be broken on non-Node.js environments.
Support useEvent (async context) in cloudflare workers
Dec 21, 2023
Environment
Nitro 2.8.0
Nodejs: 20 (on my windows 11), but, in production, using Cloudflare pages preset while building my app.
Reproduction
Using
useEvent()
directly instead of explicitly passing inevent
gives this error:500 Nitro request context is not available. Note: This is an experimental feature and might be broken on non-Node.js environments.
Describe the bug
Of course, Cloudflare is not node environment, so the error is logical and clearly states this. But, is there any way can we have this feature in non-node environment? I mean is it actually possible? Else I will simply have to keep passing event in each function in the
utils
folder. Thanks.Additional context
Currently, the Nitro docs say:
Also, these are the docs for Async Local Storage option in Cloudflare. https://developers.cloudflare.com/workers/runtime-apis/nodejs/asynclocalstorage/#caveats. Do these caveats prevent Nitro from adding this feature in Cloudflare Pages preset?
Logs
No response
The text was updated successfully, but these errors were encountered: