You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The environment variables should be available and properly loaded after building the project.
Actual Behavior
The environment variables do not work as expected after the project is built.
Additional Context:
I suspect this might be related to how dotenv or Remix handles environment variables during the build process. Please let me know if additional configurations are needed.
The text was updated successfully, but these errors were encountered:
In Remix, dotenv is only used on development, when running your app in production mode after building it it won't use dotenv automatically for your
You can manually use dotenv in production if you want but the recommendation (even from the authors of the .env file) is to only use it for dev and in production use actual env variables in your system.
Reproduction
Description:
I am facing an issue where environment variables defined in the .env file at the project root are not working after building the project.
Steps to Reproduce:
Define environment variables in a .env file at the project root:
Configure dotenv in vite.config.js as follows:
Build the project.
System Info
Remix Framework Version: remix v2 Node.js Version: >=20.0.0 Operating System: Ubuntu 24.04.1 LTS
Used Package Manager
npm
Expected Behavior
The environment variables should be available and properly loaded after building the project.
Actual Behavior
The environment variables do not work as expected after the project is built.
Additional Context:
I suspect this might be related to how dotenv or Remix handles environment variables during the build process. Please let me know if additional configurations are needed.
The text was updated successfully, but these errors were encountered: