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
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.
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
The text was updated successfully, but these errors were encountered: