TypeError: Cannot read property 'baseUrl' of undefined
See original GitHub issueIf I try to run that piece of code:
var gateway = braintree.connect({
environment: braintree.Environment[config.braintree.environment],
merchantId: config.braintree.merchantId,
publicKey: config.braintree.publicKey,
privateKey: config.braintree.privateKey
});
module.exports.gateway = gateway;
I got a TypeError:
TypeError: Cannot read property 'baseUrl' of undefined
at Config.baseUrl (***/node_modules/braintree/lib/braintree/config.js:36:28)
at Config.baseMerchantUrl (***/node_modules/braintree/lib/braintree/config.js:40:17)
at new TransparentRedirectGateway (***/node_modules/braintree/lib/braintree/transparent_redirect_gateway.js:39:34)
at new BraintreeGateway (***/node_modules/braintree/lib/braintree/braintree_gateway.js:69:32)
at Object.connect (***/node_modules/braintree/lib/braintree.js:42:10)
at Object.<anonymous> (***/helper/braintree.js:10:25)
Any ideas on that?
Issue Analytics
- State:
- Created 8 years ago
- Comments:5
Top Results From Across the Web
Cannot set property 'baseUrl' of undefined - Stack Overflow
The error in cause is: TypeError: Cannot set property 'baseUrl' of undefined. var AuthClient = (function () { function AuthClient($http, baseUrl) ...
Read more >TypeError: Cannot read property 'baseUrl' of undefined · Issue ...
Describe the bug I used npx -p @storybook/cli sb init to add Storybook to my Angular component library monorepo (using Lerna).
Read more >Cannot read property 'baseUrl' of undefined - Bountysource
angular.js:14642 TypeError: Cannot read property 'baseUrl' of undefined at new controller (formio.js:15713)
Read more >Cannot read property 'baseUrl' of undefined-Reactjs
Coding example for the question React Jest TypeError: Cannot read property 'baseUrl' of undefined-Reactjs.
Read more >cannot set properties of undefined (setting 'axios') - You.com
Axios Uncaught TypeError: Cannot read property 'map' of undefined. 1. Clicking routes in Header refreshes page in vuejs with prerender-spa plugin after ...
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
To anyone else who came across this issue. I had to change the environment property to load from
braintree.Environment.Sandbox
rather than passing in"Sandbox"
or you could amend to the following and still pass
"Sandbox"
This worked for me