I'm having some problems with my connection from my Angular app to the buy-button-js. It was working for years and we have no problem with it until recently when we noticed the products were not fetching correctly. The error is pasted below from the browser console.
This is my init code:
products:1 Uncaught (in promise)
When did this issue start? Does it affect your website in Preview mode as well, or only Live website? We are dealing with an issue which has been preventing our product pages from loading on the Live website (though it still works properly in Preview). We have used the same code for 7 years without any issues, until this started happening last weekend. Are you getting any answers from Shopify? We have opened tickets and escalated for days without any help... very frustrating and feeling hopeless.
Issue started maybe 2 weeks from now, I followed the instructions again to set up the buy-button-js from https://shopify.github.io/buy-button-js/ but no luck. I've actually figured what I had to do and it's to follow the instructions from the js-buy-sdk https://shopify.github.io/js-buy-sdk/ and use the UMD version of the js file that includes all fields I need that are listed in the error above.
"You can also fetch the unoptimized release for a version (2.0.1 and above). This will be larger than the optimized version, as it will contain all fields that are available in the Storefront API:"
So now I'm using GraphQL to query the handles to list the products to use with the buy-button-js library. A huge pain but it's the only workaround for me right now. Also, I can't figure how to use the js-buy-sdk in my frontend client Angular in the angular.module so I moved it to my express app on the backend.
I hope someone is able to fix the issue with just using buy-button-js.