Whenever I push new changes to the main branch of my git repo, netlify builds and deploys to production.
Everything seems to be working fine except the Stripe links. When netlify deploys automatically, the Stripe links are broken. However, if I deploy it via my local machine terminal by running netlify deploy --build --skip-functions-cache --debug --prod, the stripe link works as expected.
Thanks @hrishikesh. That link was a good starting point:
In case someone is facing the issue in the future, the following helped:
You’d have to first add the stripe environment parameter that is being in the frontend to the redwood.toml file like below:
title = "Your Web Title"
port = 8910
apiUrl = "/.netlify/functions"
includeEnvironmentVariables = ['NODE_ENV', 'STRIPE_PK'] # any front-end ENV vars that should be available
Then you’d have to add this variable to netlify’s domain Environment Variable as well.