Deployed using Bolt.new when my site tried to process a stripe payment the redirect page gives 404

Hello All,

I’m experiencing an issue after processing a test payment on my app that’s deployed on Netlify: Space to Talk - A Safe Space for Conversation.

When processing a test payment for a lifetime access plan via Stripe, the payment is successfully processed. However, after the successful payment, the user is redirected to the following URL: Space to Talk - A Safe Space for Conversation, but it results in a 404 error page.

Interestingly, this URL works perfectly when accessed within my web app, but when accessed directly outside of the app, it leads to the 404 error. After the payment is completed, the user should be redirected back to the chat page, and their profile should be updated to show lifetime access.

Here are the technical details:

Frontend: React and Tailwind CSS
Backend: Supabase (for the database) and Deno Edge Functions (for server-side logic)

Could you help me identify what might be causing the issue, particularly the 404 error after the payment redirect?

Additionally, I’m wondering if the problem could be related to the Netlify free tier. Could this deployment tier be limiting the functionality of the app, and would upgrading to a higher tier resolve the issue with the redirect functionality not working properly?

Thanks in advance for your help!

Hi, @Foxinthecity. I want to be clear that these forums are primarily used for debugging Netlify itself and not for debugging the code you write or written by third-parties. Now, that said, people often do ask questions about the code they write or third-party code here and sometimes they get answers. However, this is not covered under the technical support scope that the support team at Netlify provides so if you are going to get help with the custom code, it probably will come from others on this forum and not from Netlify itself.

I am also very much confused by this:

Interestingly, this URL works perfectly when accessed within my web app, but when accessed directly outside of the app, it leads to the 404 error.

How can a website be accessed other than by accessing the website? How do you access a website outside of the website?

Are you saying when you click the link on the page it works? If so, that route is likely handled by client side routing. If that is what you mean, this support guide has the solution:

If there are other questions about this, please let us know.

@Foxinthecity I answered a question identical to this recently, so it seems that Bolt AI is consistently generating this particular issue for users.

The solution will be exactly as @luke has already provided, but perhaps the comments I made in this other thread will help explain what’s occurring:
https://answers.netlify.com/t/stripe-checkout-redirecting-to-404-on-netlify/143374

Thank you so much. this resolved the issue.
The challenge im now facing is that after payment is successful it should pop up a successful payment toast and remove restirctions on the users account, its not doing that. It’s treating the account like it never made payment. Is there something addtional I need to do or add to the redirect file to make sure my site is recognising the payment has been successful and trigger the account change in its databse? thanks.

@Foxinthecity Great, glad to hear you were able to deploy an appropriate rewrite.

Your follow up ‘challenge’ is unrelated to Netlify, so you’ll need to seek support elsewhere.

Since the code is generated by AI you may want to just keep communicating with the AI.
If that doesn’t work, contact the support team of the AI platform you’re using.

The links for Bolt’s support are:
https://support.bolt.new/home
https://support.bolt.new/faqs/support
https://support.bolt.new/bugs-and-features/overview

Netlify’s support team only assist with Netlify related questions, as outlined in their ‘Scope of Support’:
https://www.netlify.com/support-scope/

Base functionality of Netlify’s build and deploy pipeline is supported, but we cannot help you debug any source code used either during build or after deployment.