matfish2 / vue-stripe

Vue.js 2 Stripe checkout component
https://www.npmjs.com/package/vue-stripe
MIT License
58 stars 18 forks source link

"export 'StripeCheckout' was not found in 'vue-stripe' #24

Closed alokstha1 closed 7 years ago

alokstha1 commented 7 years ago

@matfish2 Whenever I try to run "yarn run dev" it gives me above error. And "[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option. " error on the console.

I tried with adding "import { StripeCheckout } from 'vue-stripe';" and export default { data: () => ({ //options }), components: { 'stripe-checkout': StripeCheckout }, } in one of my vue file. Is there anything wrong I did here? Thank you in advance.

hammygoonan commented 7 years ago

I'm getting the same error. At first I got the 'Problem with es2015 relative directory' issue. But once I installed babel-preset-es2015 I get an error saying:

"export 'StripeCheckout' was not found in 'vue-stripe'

My guess is that they are related.

alokstha1 commented 7 years ago

I didnot get anything like 'Problem with es2015 relative directory' issue.

I got the same error ""export 'StripeCheckout' was not found in 'vue-stripe'". But when I use "import StripeCheckout from 'vue-stripe';" without brackets '{}' I get no error but there arise another problems like no key found and such errors. I guess this is incomplete.

@matfish2 it would be very helpful, if you could sort this out and push the updates.

andreins commented 7 years ago

You can work around this by doing something like import Stripe from 'vue-stripe components: {'stripe-checkout': Stripe.StripeCheckout, 'bus': StripeCheckout.Bus}

erinalahorlbeck commented 7 years ago

I've been getting this error too and it is driving me crazy. I tried the workaround from @andreins but I think his 'bus': StripeCheckout.Bus should be 'bus': Stripe.Bus. Either way, it seems that simply running the import statement -- with this workaround -- makes the original error go away, but once I run it in the browser, I get Uncaught TypeError: Vue is not a constructor and nothing related to Vue works. (Even if I don't add Stripe.StripeCheckout as a component, only import.)

connor11528 commented 7 years ago

Having the same issues as described by @shorlbeck and @alokstha1

alokstha1 commented 7 years ago

Thank you guys for the reply.