You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior init_stripe script runs using the key defined in .env and successfully returns the STRIPE_PREMIUM_PLAN_PRICE_ID to stdout, as defined in the README.md
The user will be presented with the following error
Task init:stripedenorun--allow-read--allow-env--allow-nettasks/init_stripe.ts
error: Uncaught(inpromise) Error: Stripeisdisabled.if(!isStripeEnabled())thrownewError("Stripe is disabled.");
Workaround steps
If you manually pollute the env with export STRIPE_SECRET_KEY=some_key and re-run the task deno task init:stripe you will be presented with the expected output
Suggestions
I believe there is an opportunity to show off the robustness of .env in Deno when fixing this.
In particular
Location specific .env files such as .env.local and .env.production which can be loaded with Stripe test vs real keys.
Guards via .env.example where STRIPE_SECRET_KEY and STRIPE_PREMIUM_PLAN_PRICE_ID can be defined but loaded with allowEmptyValues: true, . null / empty / Falsey values would indicate a desire to not use the Stripe feature.
Increased use of --env in tasks such that we are always loading a .env
The text was updated successfully, but these errors were encountered:
Expected behavior
init_stripe
script runs using the key defined in.env
and successfully returns theSTRIPE_PREMIUM_PLAN_PRICE_ID
to stdout, as defined in the README.mdIssue Reproduction steps
Run:
deno task init:stripe
With:
# .env GITHUB_CLIENT_ID=some_id GITHUB_CLIENT_SECRET=some_secret STRIPE_SECRET_KEY=some_key
and
# .env.example GITHUB_CLIENT_ID=xxx GITHUB_CLIENT_SECRET=xxx STRIPE_SECRET_KEY=xxx
The user will be presented with the following error
Workaround steps
If you manually pollute the env with
export STRIPE_SECRET_KEY=some_key
and re-run the taskdeno task init:stripe
you will be presented with the expected outputSuggestions
I believe there is an opportunity to show off the robustness of
.env
in Deno when fixing this.In particular
.env
files such as.env.local
and.env.production
which can be loaded with Stripe test vs real keys..env.example
whereSTRIPE_SECRET_KEY
andSTRIPE_PREMIUM_PLAN_PRICE_ID
can be defined but loaded withallowEmptyValues: true,
.null
/empty
/Falsey
values would indicate a desire to not use the Stripe feature.--env
in tasks such that we are always loading a.env
The text was updated successfully, but these errors were encountered: