-
-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Discussion] - Support for Nuxt or SSR Vue #72
Comments
Hello @seenickcode thanks for the insight. I am considering to support Nuxt sooner or later, but for now, since this version is just a testing version and is highly subjected to breaking changes, I am still experimenting stuff. But yeah, we'll get there (Nuxt). Your suggestions makes sense, I will try to implement them the soonest. Thank you for your help. |
Heya. The changes proposed by @seenickcode worked perfectly for me using it with nuxt. Would be great to this in 🙏 |
Hello @seenickcode I merged the I am not that knowledgeable in Nuxt so I would appreciate if you could re-fork the latest master and make some suggestions on how to properly implement the latest version in Nuxt. I will do my best to accommodate any solution. Thank you for your help. So much appreciated. Let's keep this thread open for discussion. |
Hello @seenickcode any updates? Thanks. |
I am needing this too, I will try forking and doing a pull request |
Please do @DanielRivers thanks. |
@DanielRivers ^ updates? |
Hello all, may I know how you implemented this? So I tried to tinker around nuxtjs these past few days because of this issue. As per @seenickcode's description, he is importing the scripts the "nuxt way" in the the nuxt config (?). Anyways, I created this component with the In the component where I want to use the checkout, I just imported the checkout component like:
—and used it as a normal component. There are no extra configuration in the I would create a nuxt example for this if I have time this weekend. For the meantime, kindly let me know if this will work for you guys. Thanks. Also, one of my colleague tried this implementation as well. And according to him, it also works. NOTE This has been tested on the generated nuxt files using |
I tried this and I got an error:
window is not defined due to SSR. Code:
|
@weihao thank you for confirming. I will check this. |
Thanks for the support! Please keep us updated. |
UPDATE: After trying a couple of things, I finally came up with something. I will make a test branch for this so we can all test it. |
Awesome, let me know and I can help out testing. |
Hello @jofftiquez, were you able to make a test branch? I would gladly give you a hand testing this if needed. |
I ran into this issue using this component with Gridsome. Was able to get around it by creating a duplicate of vue-stripe-checkout.js, wrapping its content in |
Thanks @platform-kit for the updates. Everyone, I'm sorry I've been really busy lately. Please kindly try the workaround solutions requested here. I will fix this soon. |
Im trying to get NuxtJS working with the vue-stripe-checkout, Can you explain just a bit how you managed to get this working? Thanks! |
Duplicate the file "vue-stripe-checkout.js" from the node_modules/vue-stripe-checkout (this package). Add
at the very beginning of that file, and Then import this file instead of the original. |
In nuxt, you can load stripe only in your component, so you won't have to load stripe on all pages.
Looking forward to seeing this module perfectly working for nuxt. |
Stripe is working well locally, but I cannot see "card input" on server. |
@jofftiquez is this still in the roadmap? I want to upgrade my stripe version to support 2-way-authentication and I would like to know if I can make this work with Nuxt :) |
Hello @Jesus82 as a matter of fact, yes, this is still in the roadmap. Lemme see if I can raise the priority on my schedule. I'll let you guys know. Thanks. |
Hello guys! I'm solved "window is not defined" problem by modifying vue-stripe-checkout files directly in node_modules. But when I'm deploying my nuxt project to netlify - it doesn't see my edited and fixed file. How can I solve this? |
@Rouzy777 see my comment above. You'll need to save the modified file in a directory other than node_modules and import from there, since the node_modules directory is rebuilt upon deployment. |
@platform-kit Many thanks! |
Hello all, I've been working with nuxt a lot recently, while I can't really get back to this yet, I think I already have some solutions in mind that I can test in the next days. I apologize for having this issue open for so long. I will do my best to find time to fix this. Thanks and stay safe y'all. |
Hello all, I hope you'll find time to read this. This is just to summarize the current state of the project, and its future. |
Hello all! Here's a big update for y'all! The good news is, there are NO changes in Please check this new repository I created https://github.com/jofftiquez/vue-stripe-checkout-nuxt-demo This demo repo also has the complete step by step guide on how to use vue-stripe-checkout in nuxt. This has been tested in both SPA and SSR mode. Likes to the demo are also included in the README Please take your time to check it out. And let me know what you think. Thank you all for being patient with this project. |
Hello guys, may I have your feedback on this? I will be closing this issue in few days if don't get anymore issues regarding Nuxt.js thank you. |
@jofftiquez I don't use nuxt, but I am curious about whether the changes you make will affect vue-stripe-checkout's use in Gridsome? Is the fix Nuxt-specfic? |
No @platform-kit, there are actually no actual changes made to the codebase. I just created a guide on how to properly use it with nuxt.js. There should be no changes to the way the plugin works in any way. :) |
@jofftiquez Then it would seem that a fix is still required to make it useable in Gridsome. Shall I open a new issue? |
Hmm gridsome. I'm not quite familiar with it yet. Yes please that would be awesome. So that we could also have a separate thread for it. Thanks! |
I would love to give feedback (and am excited about your new direction with this) - but I'm having issues with managing subscriptions - just don't know how to set it up properly. Any guidance? |
Hello @jhull would you mind making a new issue for that? Thank you :) |
Hello all! Thank you all for participating in this issue, and for being patient. All help is so much appreciated. I will be closing this issue now. Happy coding everyone! <3 |
Hello,
I'm using the
refactor/v3
branch with a Nuxt application. Since Nuxt supports SSR, I get errors that 'window' and 'document' are undefined, naturally because the component gets rendered server side first.What I did to try to get things to work is fork and create my own
refactor/v3
branch. It looks like the changes I made are working, one just has toimport their own
stripe.js
file in thehead
component, as this cannot be created during Vue'screated()
because your branch requires a reference todocument
simply customize
successUrl
andcancelUrl
as one normally would, as your branch seems to usewindow.location...
.Here's the fork if you are interested. Ensure you take a look at the
refactor/v3
branch I have. https://github.com/seenickcode/vue-stripe-checkout/tree/refactor/v3I'd like to know your thoughts and if this v3 you have can be supported by SSR Vue, esp with the popular Nuxt framework.
Thanks,
The text was updated successfully, but these errors were encountered: