-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
Usage of process.env in Nuxt #751
Comments
Hi @puzzle-it-nu 👋 I agree with your take here! However, we have to be careful. As we use NextAuth under the hood, certain environment variables need to be set via I have had reworking the environment variables and configuration for NuxtAuth on my list for a while, as I feel that at the moment it is very difficult to properly assess which environment variables need to be set for which provider. I would love to work with you on improving this! In my opinion, we should begin by outlining which configuration and environment variables are required for which settings and how we can make them feel more native to Nuxt. I also know that we still have a few PR opens that also touch the environment variables (notably: #711). In addition to this, I think we need to update the docs and properly outline the possibilities for how configurations can be set. There is often confusion about this (See: #368) In conclusion: I would love to receive some help from you on this issue! I personally would propose that we as a first step outline the changes and get a proper overview of what could be improved. Afterward, it would be amazing, if you opened a PR to account for these. Alternately, you can also immediately open a PR, however we may request substantial changes, depending on the changes! If I can support you in any, feel free to ping me on GitHub or add me on discord (zoeykaiser) 😊 |
Thanks for the heads up and detailing some of the difficulties that I didn't know about. My, naive, thinking was that using only I have read the mentioned PR and issue and I wonder whether it would be possible to come up with reproductions and/or a table listing working/not working combinations. Right now I have a hard time keeping track of what works and what doesn't. Personally I haven't had the above mentioned problems but that doesn't mean they don't exist. I'm gone on a 2 week vacation and hope to have time after that to look into it. |
Potentially resolved by #837 |
Closing as in #837 we now switched to a more flexible approach where both normal and Nuxt environment variables can be used. |
Environment
First of all thanks for all you hard work, really appreciate it.
Reproduction
Its an issue about documentation, so rather hard to reproduce :-)
Describe the bug
The following came up during a discussion with a new team member on our Nuxt3 project. According to the Nuxt documentation you shouldn't use process.env to get at environment variables.
What happens if you build for a deployment that doesn't have a process object just like SSR doesn't have a windows object.
Shouldn't this example use Nuxt3 best practices?
If you agree I'm willing to write a PR for this instance and also for other instances if there are any.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: