Replies: 1 comment
-
What do you get when you run build locally? I don't think the env vars are being passed to your application. Can you prefix them with GATSBY_ ? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a project that uses Gatsby default starter with fully dynamic app that fetches data through was api gateway and uses was cognito authentication.
Running locally and testing the build in Aws S3 everything works fine.
But trying to deploy it through GitHub and Amplify, the environment variables referenced in the application are undefined.
I have entered the env variables both through the console and into the yaml file, but still the same problem.
Referencing them in the code like so:
const [isLoading, setIsLoading] = useState(true) const [orders, setOrders] = useState({}) const path = process.env.ERP_API_URL const erp = process.env.ERP_COMP_NO const id = props.id const callback = props.callback const [error, setError] = useState(false)
Need help. Thank you in advance
Beta Was this translation helpful? Give feedback.
All reactions