500 Error on Shopify Graphql - Buy One Get One Discount breaks cart

Describe the bug
Shopify Buy One Get One discount breaks cart functionality.

The following instructions are based off of this minimum reproducible example which uses Shopify’s own code! Here is a Loom video which demonstrates the issue

Steps to reproduce:

  1. Create a collection listing all products example
  2. Create a Buy One Get One Discount example
  3. Using this example code in react-js-buy folder, add a product that is part of the Buy One Get One discount (eg “Foundations in MDMA Safety, Therapeutic Applications & Research”) to cart multiple times

Expected:

Cart should show line items with quantity.

You should be able to add or remove the line items from cart.

Actual:

Strange presentation in the cart with same variant split into multiple line items.

You’re unable to remove line items from the cart which are involved in the BOGO discount. 500 error from the graphql endpoint for example:

index.js:4078 Uncaught (in promise) Error: [{"message":"Internal error. Looks like something went wrong on our end.\nRequest ID: 9ef6a61e-3635-4426-b263-b7c59582e46f (include this in support requests).","extensions":{"code":"INTERNAL_SERVER_ERROR","requestId":"9ef6a61e-3635-4426-b263-b7c59582e46f"}}]

Code Example:
Here is a minimum reproducible example code based off of the storefront-api-examples repo

Video Example:
Here is a Loom video which demonstrates the issue

This issue is also open on Shopify Buy github https://github.com/Shopify/js-buy-sdk/issues/926

1 Like

I keep getting told by Shopify support to “contact the third party theme developer” which is really annoying because I’ve put in the time to reproduce the issue with Shopify’s own code!!!

1 Like

I’ve also opened this issue on Shopify Buy github, no response there for days https://github.com/Shopify/js-buy-sdk/issues/926

1 Like

Same issue

Hey @shawngrona and @whitesunset - thanks for getting in touch and for opening up that Github issue in the JS Buy SDK repo. That’s usually the best way forward to get issues related to specific libraries/dev tools looked at, but I’ve also raised this internally on my end in case it is related to something within a Shopify component rather than the Buy SDK. I can’t guarantee a direct response through the forums, but I did want to touch base to let you know that we are looking into this.

I wanted to chime in to mention that we are seeing this issue when trying to remove the last line item from the cart using the shopify-buy SDK as well. Hopefully this issue is resolved. It wasn’t an issue a few days ago. Maybe something was pushed to production that isn’t playing nice with the buy SDK?

2 Likes