Search code examples
reactjsaws-amplify

Error in setting up AWS amplify environment variables, but nothing appears in build. how to fix it?


I am using aws amplify environment variables as follows, but not getting the set variables in the react frontend. I followed various stackoverflow tutorials and ended up with this. I rebuild the project after making changes, did not work.. Would be grateful for the help

enter image description here

enter image description here

enter image description here

enter image description here


Solution

  • Seems I needed to add REACT_APP_ on every env Variables for create-react-app. eg: REACT_APP_MUNICIPALITY_NAME,

    ref: How to add environment variables to AWS amplify?