-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: make env setup work in middleware #1000
Comments
Could you explain more precisely what you are trying to do? Accessing env vars in middleware works just as it would anywhere else, see: c-ehrlich/mwenv@492bef2 |
Sorry, not speaking of trpc middleware, but of Next.js middleware. |
Just tried and can confirm that this currently doesn't work, the import makes Next middleware blow up. Accessing the environment variables in a non-typesafe way (ie What would we need to do to get it to work, and are there any downsides? |
I think the only way to work around this, is to define the server env vars the same way, as we do with the client env vars (explicitly building our env object before verifying). |
fixed by #1021 |
Is your feature request related to a problem? Please describe.
I am currently facing a problem, when using the environment variable setup from t3 and I am opening this issue, since the other issue about environment variables not working (#999) was closed by the author.
Describe the solution you'd like to see
It would be necessary (for now – don't know, if this is being fixed, though) to also compose the server env vars, like we do for the client env vars.
Describe alternate solutions
non that i can think of.
Additional information
No response
The text was updated successfully, but these errors were encountered: