Sections API is sometimes returning null

In the last 30 minutes the sections value in the cart ajax response has started return null about 50% of time. There have been no changes to the section that is being requested. The request completes when doing a cart ajax request and the cart is mutated correctly but the section value in the response is just null

Issue has been escalated by shopify support:

Just to recap: you reported intermittent null responses from the Section Rendering API in your cart AJAX requests, affecting multiple stores using your app at around 50% of requests. We traced the failures to an internal 302 redirect error and escalated to our Front End Developer Support team with all the request IDs and store details. They’ll follow up with you via email. Thanks for your patience and for providing all that detail, it really helped us get to the right team quickly.

After adding some logging to record when the section is null in the cart ajax response it seems to be happening in spikes instead of consistently. Below is a chart of the error logs over the last hour.

The number of stores its effecting seems to be increasing over time as well. It has doubled in the last 30 minutes

Update from Shopify: Cart updates are succeeding. The failure is in the step where Shopify renders the requested sections after the cart changes. In every failing request you sent, the store was being viewed through a theme preview session. In that case, the section render can be redirected internally and come back empty. Shopify still returns HTTP 200, but with sections: null. Whether a given request is affected depends on how each request is handled internally, which is why you saw it only some of the time.

Shoppers browsing the live, published theme don’t go through this preview path, and in the period we reviewed we found no shopper traffic affected on the stores you mentioned. We’ve passed this to our engineering team so the section render handles this case properly.

We just identified this exact bug as well which threw an error when trying to add to cart on our live store.

The /cart/add request was returning HTTP 200 and successfully adding the product, but the response contained sections: null, causing our custom cart drawer to throw a JavaScript error when attempting to render the missing sections.

We confirmed the same behaviour with /cart/update.js, while requesting the sections independently via GET returned the expected HTML.

I’ve implemented a temporary workaround in product-form.js that detects missing bundled sections, retrieves them separately using the Section Rendering API, and merges them back into the response before rendering the cart drawer.

This has resolved the issue in our testing, but it certainly appears to be a Shopify-side regression rather than a theme issue.