I am trying to access environment variables in Netlify with create react app. I followed instructions from this post, which provided a repository that is already configured and set up with environment variables that supposedly works when deployed to netlify. I cloned that repo and initialized with netlify cli, build and then deployed to netlify and it didn’t work.
This is what it’s supposed to look like
But with my page, all the variables are empty
In the Netlify dashboard I set REACT_APP_CUSTOM_ENV_VAR
to “From Netlify”
In netlify.toml I set a few variables
[build]
command = "yarn build"
publish = "build"
[context.production.environment]
TOML_ENV_VAR = "From netlify.toml"
REACT_APP_TOML_ENV_VAR = "From netlify.toml (REACT_APP_)"