Conversation
add a new option to `getCloudflareContext` that makes it run in "async mode", the difference being that the returned value is a promise of the Cloudflare context instead of the context itself The main of this is that it allows the function to also run during SSG (since the missing context can be created on demand).
🦋 Changeset detectedLatest commit: 621718e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Co-authored-by: Victor Berchet <victor@suumit.com>
Co-authored-by: Victor Berchet <victor@suumit.com>
Co-authored-by: Victor Berchet <victor@suumit.com>
Co-authored-by: Victor Berchet <victor@suumit.com>
|
@vicb sorry I had to update the logic in PS: ideally all the different error cases of this (and their error messages) should be tested, for that we would need an extra app that doesn't set |
Co-authored-by: Victor Berchet <victor@suumit.com>
4e509bc to
30683e7
Compare
…ync` and `getCloudflareContextAsync`
vicb
left a comment
There was a problem hiding this comment.
Maybe:
const InitOpenNextCloudflareForDevErrorMsg =`...`;
...
throw new Error(InitOpenNextCloudflareForDevErrorMsg);
add a new option to
getCloudflareContextthat makes it run in "async mode", the difference being that the returned value is a promise of the Cloudflare context instead of the context itselfThe main of this is that it allows the function to also run during SSG (since the missing context can be created on demand).
Closes #371
Docs PR: opennextjs/docs#75