Stripe API call is breaking all local setups
See original GitHub issueDescribe your problem and - if possible - how to reproduce it
When following the instructions in the contributors guide there seems to be an unaccounted for issue.
With a fresh build, if you attempt to execute npm run develop
you’ll be presented with an error.
To resolve the error you have to add a valid Strip public and private key to the .env file before executing npm run build
. I’m not sure if the CONTRIBUTING.md should just be updated or if freeCodeCamp/server/boot/donate.js could be updated to prevent this issue.
Here is the error:
/home/charles/development/freeCodeCamp/server/boot/donate.js:62 throw err; ^ Error: Invalid API Key provided: sk_from_*****_*****oard at Constructor._Error (/home/charles/development/freeCodeCamp/node_modules/stripe/lib/Error.js:12:17) at Constructor (/home/charles/development/freeCodeCamp/node_modules/stripe/lib/utils.js:133:13) at new Constructor (/home/charles/development/freeCodeCamp/node_modules/stripe/lib/utils.js:133:13) at IncomingMessage.<anonymous> (/home/charles/development/freeCodeCamp/node_modules/stripe/lib/StripeResource.js:164:21) at emitNone (events.js:111:20) at IncomingMessage.emit (events.js:208:7) at endReadableNT (_stream_readable.js:1056:12) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickDomainCallback (internal/process/next_tick.js:218:9) [08:19:31] [nodemon] app crashed - waiting for file changes before starting...
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Handle errors | Stripe Documentation
Stripe offers many kinds of errors. They can reflect external events, like declined payments and network interruptions, or code problems, like invalid API...
Read more >Stripe API reference – PHP
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries....
Read more >Stripe API reference – Errors – curl
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries....
Read more >API upgrades | Stripe Documentation
Listed below are all the breaking changes to the Stripe API. Each date corresponds with a new version of the Stripe API. If...
Read more >Rate limits | Stripe Documentation
The Stripe API locks objects on some operations so that concurrent workloads don't interfere and produce an inconsistent result. The error above is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe this is related, as running
npm run develop
even when not testing Stripe, causes the program to raise the errorAny help? I see no reason there should be a Stripe API call when starting up the server.
If you don’t want to go to the trouble of creating your own Stripe account, I found the following test keys in the Stripe documentation:
STRIPE_PUBLIC=pk_test_g6do5S237ekq10r65BnxO6S0 STRIPE_SECRET=sk_test_BQokikJOvBiI2HlWgH4olfQ2
Drop these into
.env
and you’re good to go!