Skip to content

Adds environment variable validation #1198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 2, 2023
Merged

Adds environment variable validation #1198

merged 5 commits into from
Oct 2, 2023

Conversation

manovotny
Copy link
Collaborator

@manovotny manovotny commented Sep 15, 2023

We get 1 -3 issues or comments a week about build errors (see #1189 and #1197, for example), which are due to missing environment variables.

This PR add some validation during the build process to ensure absolutely required env vars are present and throws a clearer error message.

CleanShot 2023-09-16 at 19 59 28@2x

@vercel
Copy link

vercel bot commented Sep 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
commerce-shopify ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 2, 2023 3:18pm

Copy link

@orca-security-us orca-security-us bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca

@aanomm
Copy link

aanomm commented Sep 16, 2023

i've also seen multiple matters of confusion around these Shopify variables — including my own — and upon requesting clarification the responses have been very dismissive — including to my own. it's clearly a point of confusion for many so perhaps the relevant docs aren't quite clear enough and/or could be better

@manovotny
Copy link
Collaborator Author

manovotny commented Sep 17, 2023

@fucha-co happy to make changes! Can you explain what is unclear? Do you have suggestions on what changes should be made?

@leerob leerob merged commit 5cb1245 into main Oct 2, 2023
@leerob leerob deleted the validate-env-vars branch October 2, 2023 15:18
bc-alexsaiannyi pushed a commit to bigcommerce/nextjs-commerce that referenced this pull request Dec 7, 2023
* Adds environment variable validation

* Adds bracket checking in SHOPIFY_STORE_DOMAIN

* Prettier

* Adds link

---------

Co-authored-by: Lee Robinson <lrobinson2011@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants