Environment variables not working on aws amplify

0

Hello,

I am deploying a next app on aws amplify, next version 13.4.12. I have tested the web app locally and everything works correctly. I have environment variables set up with connections to a database, and I'm able to submit information through a form and add it to the database.

In amplify, I've added the environment variables under App settings > Environment variables, and I've also updated the build settings under App settings > Build settings to match the documentation found here. In fact, in one case I directly copied the - env | grep -e DB_HOST ... command because my variables are set up exactly the same.

For some reason though, when I deploy my next app on my custom domain through amplify, the webapp works fine except for the form and updating the database. I input data, press submit on the form, and my database does not update. I do the exact same thing locally, and my database updates.

I can verify that all of my code is the same locally and on github, and amplify pulls from github.

If it helps, my database is sql on aws..

1개 답변
0
수락된 답변

I realized that this was not an issue with my environment variables; it was an issue with my query. Although it worked locally, the code was sloppy, so it didn't work on amplify. I fixed the query, and now it works.

Jeff F
답변함 10달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠