#timothywu-help

1 messages · Page 1 of 1 (latest)

cedar finch
#

hello! can you elaborate more on what doesn't work?

  • Which guide are you referring to? can you share the link?
  • what were you expecting to happen? What happened instead?
  • do you have a url which we can access to take a look?
rapid bluff
#

and on local when i run npm run dev it s working well

#

but when i build it and export with npm run build and build as : "build": "next build && next export", and i try to go to the checkout page it display nothing of stripe

#

is it because it s not supported on static like html ?

topaz cradle
#

Are there any specific errors in the developer console?

rapid bluff
topaz cradle
rapid bluff
#

thanks you very much for your quick response, i m new with next so i m not sure if i can do it but i ll give a try. But i don t understand how am i supposed to use getInitialProps

topaz cradle
#

This is outside the realm of Stripe support really, but I'm quite familiar with Next.js so happy to help where I can

#

Why do you need to export to static HTML/JS?

rapid bluff
#

Thank you very much ! i have to put my commerce on a server and i was told that the server will only work with static export

topaz cradle
#

Yeah you're going to need a sever/host that can provide you with the functionality to run Node.js code (i.e. a API Route/serverless function) in order to create your Payment Intent

#

Why not host on Vercel? It's free and its the native host for Next.js apps (they created and maintain Next.js)

rapid bluff
#

we have already a server so we are trying to using it, or else we have built it for nothing 😦

rapid bluff
topaz cradle
#

To make what?

rapid bluff
#

a server that support nodejs code

topaz cradle
#

I imagine you've written the code (in the create-payment-intent function in your Next.js app)

rapid bluff
#

yes

#

on the server side

topaz cradle
#

You just need a host to deploy that function to, and I wouldn't recommend building your own server for a single Node.js function

#

Use something like Heroku to deploy it

rapid bluff
topaz cradle
#

This would be so much easier for you if you just deployed it to Vercel

rapid bluff
#

ok thanks alot for all your advice !

#

So i should abandon my server ?