braintree / braintree-web-drop-in

Braintree Drop-in for the web
MIT License
200 stars 126 forks source link

Webpack breaks paypal integration #764

Closed kaitwalla closed 3 years ago

kaitwalla commented 3 years ago

General information

Issue description

I attempted to use the drop-in UI for the platform we're building. Using the bog-standard config settings, I was able to get the buttons to load, but the Paypal option always said there was an issue. There were two errors in the console:

Uncaught TypeError: invalid 'instanceof' operand HTMLElement validate.js:106:18

and

TypeError: global.paypal is undefined dropin.js:16660:13

I was able to narrow it down a problem with Webpack - this is on a Laravel site that uses Webpack Mix to transpile everything. When I left the barest script (console.log) that still loaded Webpack, I would receive the errors. When I left the script off and didn't have Webpack loaded, it worked perfectly. Please note that the script itself was not being called through webpack - it's loaded in via Githubissues.

  • Githubissues is a development platform for aggregating issues.