Skip to content
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

Production build not reading any environment variable (not even from the machine itself or AWS) #10464

Open
mcfriend99 opened this issue Feb 5, 2025 · 0 comments

Comments

@mcfriend99
Copy link

Reproduction

My project was setup using npx remix init (nothing special).

I ran npm run build then npm start.

System Info

System:
    OS: Linux 6.8 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
    CPU: (2) x64 Intel(R) Xeon(R) Platinum 8275CL CPU @ 3.00GHz
    Memory: 3.00 GB / 3.71 GB
    Container: Yes
    Shell: 5.2.21 - /bin/bash
  Binaries:
    Node: 22.11.0 - ~/.nvm/versions/node/v22.11.0/bin/node
    npm: 11.0.0 - ~/.nvm/versions/node/v22.11.0/bin/npm
  npmPackages:
    @remix-run/dev: ^2.13.1 => 2.13.1 
    @remix-run/node: ^2.15.3 => 2.15.3 
    @remix-run/react: ^2.15.3 => 2.15.3 
    @remix-run/serve: ^2.15.3 => 2.15.3 
    vite: ^5.1.0 => 5.4.10

Used Package Manager

npm

Expected Behavior

I should be able to get environment variables from AWS and or system environment variables.

Actual Behavior

My issue is exactly as described. I've tried to set environment variables via AWS. I've also tried to set them via using the .bashrc and .bash_profile with no luck. Once I deploy a production build, it simply doesn't work. I've tried loading the environment variable with dotnet-cli and same thing.

Its not seeing any environment variable on my device. Not even the NODE_ENV that remix promises to automatically set in the production build.

console.log(process.env) in the build index file simply returns {}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant