huss_a
huss_a

Reputation: 125

React not picking up environment variables (create-react-app)

I'm trying to access the environment variables in my React App, however they aren't registering.

console.log(process.env)

enter image description here

All of my variables are in a file named .env.development.local, and are prefixed with REACT_APP_

REACT_APP_API_KEY_IF=XXXX
REACT_APP_API_KEY_MAPFLIGHT=XXXX
REACT_APP_SESSION_ID=XXXX

What could I be doing wrong here? Thanks

Upvotes: 1

Views: 73

Answers (1)

huss_a
huss_a

Reputation: 125

Alright so it looks like I was supposed to restart the server after adding new Variables, that did it.

Upvotes: 2

Related Questions