-
Notifications
You must be signed in to change notification settings - Fork 84
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem?
The getCloudflareContext() utility cannot be used in certain places as it is async function, and therefore requires awaiting. Class constructors and global variables often depend on the expectation of being synchronous, and therefore are prevented from leveraging the utility for bindings, and have to use process.env instead.
Describe the solution you'd like
getCloudflareContext() should be able to be used synchronously.
Describe alternatives you've considered
N/A.
@opennextjs/cloudflare version
0.2.1
Additional context
The next-on-pages approach to this problem involved a way to setup the environment in the Next.js config file, and then interacting with a global symbol on process.env in dev mode.
https://github.com/cloudflare/next-on-pages/tree/main/internal-packages/next-dev
Before submitting
- I have checked that there isn't already a similar feature request
- This is a single feature (not multiple features in one request)
xiaoyu2er
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
Done