Change online store handles error messages in the cart and checkout validation API?

I am serving an app using the cart and checkout validation api.

In some themes, when I press the “Add to Cart” button and the cart and check out validation api returns an error, the error message is no longer displayed.

Attached is an example from Dawn.

Below is an example of the “Dawn” theme.
Until now, a message was displayed when you clicked the “Add to Cart” button.
message-01

However, I am currently unable to display the error message.
This is thought to be due to a change in the response from the server side. This may be due to the “description property” being null.
output

Some theme just show “null”.

Is this a bug? Or is this an ongoing change?

Hey @azy :waving_hand: - I can’t say for certain without digging into this more, but it’s possible this could be an issue specific to those themes - do you have an example theme where the “null” issue appeared we can take a look at to try and replicate this?

If you’re willing to share the shop and the theme where you saw the “null” error pop up (either here on in a DM), just let me know and I’d be happy to take a look!

Hello @Alan_G -san
Thank you for your reply!

it’s possible this could be an issue specific to those themes - do you have an example theme where the “null” issue appeared we can take a look at to try and replicate this?

Theme is Venue.

I just created preview store as follows;
(please go to product handle is “products/chain-bracelet”)

pw: shopify_password_protected

I can’t find your DM link, so I can’t contact your actual shop, but please DM me if necessary.

Since I can no longer display error messages from the Cart and Checkout api, I’m trying to release code that overlaps fetch or xhr so ​​that messages can be displayed, but I would like to avoid this if possible as it may cause unexpected problems or conflict with Shopify’s standard functions.

No worries @Azy! - I can DM you on my end here so we can discuss the details of the shop if you’d prefer to keep that private. I’ll message you in just a second :slight_smile:

Hey @Alan_G I don’t think this is an issue with just a few themes.
It has been occurring since at least June 5th, and I emailed Shopify Support immediately after discovering it, but I haven’t received a response.
I would like clarification on whether this change is temporary or a specification change. Our app’s development strategy will change depending on your answer.

2 Likes

Hey @Alan_G,

We are also experiencing the same issue in our Shopify app and have received numerous inquiries from our merchants. Could you please share the latest status or any updates regarding this issue?

We would also appreciate clarification on whether this behavior is considered a permanent specification change or a temporary bug, since it will affect our app development roadmap.

Thank you in advance for your help!

Hello,
We are tracking this issue with @Alan_G -san, and it has already passed it to special team.
Looks like we’ll have to wait a while until the problem is resolved.

1 Like

Hi @kyoshi - just confirming what @azy mentioned here. We are currently working on a fix for this. I still can’t guarantee an exact turnaround time for when this will be deployed, but it is something we are actively working on and I’ll get back in touch with all of you here in this thread when I can confirm the fix has been sent out on our end :slight_smile:

2 Likes

Per this post: Unexpected change to cart.js error responses, breaking functionality
It looks like the “fix” was implemented temporarily, which actually broke my app as well as the standard functionality of a lot of existing functions/themes.

I suspect this was realised and the change was reverted back.

The current responses do not align with the docs - but changing it to align with the docs is going to probably break parts of a lot of apps & themes.

We also have a Cart & Checkout validation function, and errors returned from it go into the “message” property in the body of add.js response and we are increasingly seeing complains from merchants that errors are not being displayed in the theme, and after investigation it looks like those themes are displaying error message from “description” field instead of “message” field, is there a way we can send “message” and “description” from Cart & Checkout validation function? Otherwise,
we would have to monkey-patch xhr/fetch function and trap the error message and display it, which sounds like a massive error-prone hack

Hey @Kets_Patel, thanks for the report here as well.

We’ve identified an inconsistency in the Ajax cart error payloads and the team is actively working on a fix. There’s no action required on your Function code; Functions can’t directly control the Ajax error fields. We don’t recommend heavy client-side workarounds like monkey‑patching fetch/xhr. If you need immediate relief, themes can safely read either description or message until the fix lands (for example, read description first and, if it’s missing/null, fall back to message).

Just wanted to reach out to confirm I’m still tracking this thread and will update you folks once the change is deployed. Let me know if I can clarify anything more on my end here!

Hey folks, a fix for this has been deployed and should be rolled out, can you let me know if you are all still seeing this issue? If so, just ping me here and I am more than happy to investigate further. :slight_smile:

1 Like

Hello @Alan_G -san

Thank you for your kind response.
I have confirmed that the message is displayed properly on my development store and on the stores of customers who have installed the app.
I would like to thank Alan-san and the Shopify team for their response.
Thank you very much.

1 Like

Hey @azy, I’m glad to hear it’s working now and thanks again for your patience! If there’s anything else I can help with just let me know!