NextJS 15 with Stripe Error /.well-known/vercel/microfrontend-routing 404 (Not Found)

I dont know how to fix this error message again and need help from somebody who worked with stripe or knows why vercel is doing this. I was finished but rolled back from github… long story cant switch back.

It tells me already on Create Next App in the console visiting that there is a error with microfrontend something.
I set all enviroment variables now and also a webhook key from stripe with Endpoint-URLhttps://valet-booking.vercel.app/api/webhooks

Can anyone tell me why the stripe checkout doesnt popup again ?
I already did it and tried to fix some other thing and messed arround without chance of rolling back on github.

The expected behaivor is to calculate the price in my multi step form, send stripe the amount that is already calcuated and open up a Stripe Payment (cc, apple, paypal etc) and after that show sucess/cancel error.
Later on a admin dashboard and mail to me & client but for now not important, it cant even create a stripe session.

There’s another community post with 404 debugging tips that might be helpful. Please give these solutions a try and let us know how it goes.

A human should be around soon to offer more advice. But you can also get helpful information quickly by asking v0.

1 Like

Thanks for sharing the repo and deployment link, @onurz24. I tested the checkout workflow and ran into a 500 error in the dev tools console. So I dug into the logs for the deployment and found Stripe Error: Error: Invalid URL: undefined/success?session_id={CHECKOUT_SESSION_ID}. URLs must begin with http or https thrown from the /api/stripe function.

A missing environment variable seems to be the cause of the problem. Based on the error info, it seems be NEXT_PUBLIC_BASE_URL missing when used on this line: valet-booking/app/api/stripe/route.ts at c97834be062b9ea6dc224666940e455995983ff4 · onurz24/valet-booking · GitHub

You can add the env var in project settings. As an alternative, you can use the VERCEL_ENV system environment variable or NEXT_PUBLIC_VERCEL_URL framework env var that’s automatically populated for each deployment.

I hope that helps!

1 Like

Thank you very much i appreciate that because nobody in a Community Forum looks on whole projects and tests them. Already asked on Reddit and Stackoverflow.

I did already set the env variable this before but then you made me check again if i really set it and noticed my big typos that made the whole app not working… the variable name was NEXT_PUBLIC_SITE_URL and my /sucess/ folder should be named success with 2 c’s…
english isnt my native language.
I would have deleted everything… or tried building it as plugin for wordpress but it seems too messy/many errors in comparison to embed an iframe or redirect to an next js web app.

Now i can start building the Dashboard and Email Logic.

2 Likes

I’m happy to have helped you!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.