compile. I have a webpack configuration for development and production environment. The problem is, when I run the application locally in production mode the app works fine and loads all env vars need at runtime. When I deploy this on kubernetes, the app cannot pick any env vars in the pod. I'm using npm dotenv. I'm not sure what it is that I'm doing wrong. Some vars are undefined. Any hint or Idea on what I could be doing wrong?
Probably your main problem is that react will not pick your env variables in runtime, but will hardcode them during build. Try to check if they are available on build step
Обсуждают сегодня