getEvent() throws "Context is not available" from a server function #4540
Unanswered
lorenjerickson
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Async storage is only available on newer node versions which may be the error. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, everone. I have been chasing my tail trying to get something that should be very simple to work in @tanstack/start. The goal: read and write cookies from with in a server function. Short story is that I have a server function defined as follows:
The
post
method above is just a wrapper around fetch that adds the Auhtorization header to requests that need it. These requests are going to an external API. This seems pretty consistent with examples I have seen elsewhere, but in this case thegetEvent()
call fails with the following stack trace:Stepping through that stack trace seems to indicate that AsyncLocalStorage is not available, but I am not finding any information on why that would be, or how to fix it. Anyone else run into this?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions