adrianhajdin / ecommerce_sanity_stripe

Modern Full Stack ECommerce Application with Stripe
https://jsmastery.pro
2.19k stars 675 forks source link

500 (Internal Server Error) #26

Open Pannu786 opened 2 years ago

Pannu786 commented 2 years ago

Hi

I almost finished this project, but I face this one issue and need help here. Screenshot 2022-05-23 125935

Screenshot 2022-05-23 125851

My slug file FireShot Capture 004 - ecommerce_ slug js at main · Pannu786_ecommerce - github com

miahthegreat commented 2 years ago

@Pannu786 is it only happening when you click the Buy Now button in the banner or any product on the home page?

Pannu786 commented 2 years ago

@Pannu786 is it only happening when you click the Buy Now button in the banner or any product on the home page? Just the BUY NOW button on the banner. Other than that rest of the app works fine.

miahthegreat commented 2 years ago

It's more than likely an issue with the product slug that the banner points too. Either the product doesn't exist in Sanity or there is no image published for the product.

Pannu786 commented 2 years ago

Hmm, I will have a look. Thank for the help tho.

dmroberts302 commented 2 years ago

I think i found the problem, you imported capital Product from components when it should have been lower case product and i think this is the reason all four properties of lowercase product is null. Import product instead and let me know if this helps.

Pannu786 commented 2 years ago

@dmr019 I wish I could say it worked but it did not.

AM-Darshan commented 2 years ago

@dmr019 I wish I could say it worked but it did not.

Its the problem with ur sanity database, u have to go to banner section (open localhost:3333) and there u have "product" field. There u have to change it to a slug that is already existing in the database of any product u wanna display. Since there is no product with slug "Headphones" you are getting an error.

Pannu786 commented 2 years ago

Oh thank you for pointing that out.. I might have a look some day again into this but I appreciate you took a look. Thanks again to all of you.

On Sat, 1 Oct 2022, 21:33 Pradhan1999, @.***> wrote:

@dmr019 I wish I could say it worked but it did not.

bro you've not write logic for Buy Now button. Add code for that in HerroBanner.jsx.

— Reply to this email directly, view it on GitHub https://github.com/adrianhajdin/ecommerce_sanity_stripe/issues/26#issuecomment-1264406460, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKO6XDUGQCK65S36JMYWNCLWBBOFVANCNFSM5WU3YOQA . You are receiving this because you were mentioned.Message ID: @.***>

Pradhan1999 commented 2 years ago

@dmr019 I wish I could say it worked but it did not.

Here, slug name in Product and product name in Banner sholud be same. image image