[Feature Request]: support for next headers
and cookies
functions
#25218
JamesManningR
started this conversation in
Ideas
Replies: 1 comment
-
Is anyone interested in creating a PR to implement this? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
May be a duplicate of #19523
Using the next
headers
orcookies
functions leaves you these errors respectively:Invariant: headers() expects to have requestAsyncStorage, none available.
`Invariant: cookies() expects to have requestAsyncStorage, none available.
Describe the solution you'd like
I think it would be ideal if the next plugin handled the usage of these functions out of the box
Describe alternatives you've considered
For anyone looking on how to solve the next headers/cookies and looking for a quick fix: specifically for webpack
Using this section of the docs
You can create a next
headers
mock (and by extensioncookies
)I've marked any new files with * their location doesn't matter
Then just add the headers you need to the story/preview
This will at least give your stories the ability to run, albeit very mocked so only use this to tide over until a better solution is suggested / implemented
Originally posted by @JamesManningR in #21540 (comment)
Are you able to assist to bring the feature to reality?
yes, I can
Additional context
Mentioned here:
#21540 (comment)
Beta Was this translation helpful? Give feedback.
All reactions