Resolved! The issue had to do with the Vercel Commerce starter. It was storing and retrieving the Storefront-API created checkout URL in cookies using some characters that can be unsafe in cookies, notably, =. This caused the retrieval of the checkout URL to remove the value of the key query parameter, and so the checkout URL was invalid, which then caused the redirect on Shopify’s side.
Topic summary
A developer encountered an issue where attempting checkout on a headless Shopify storefront (built with Vercel Commerce starter) redirected users back to the Shopify store’s homepage instead of completing the checkout process.
Root Cause:
The problem stemmed from the Vercel Commerce starter’s cookie handling. It stored checkout URLs using unsafe characters (notably =), which caused the checkout URL to become invalid. This triggered a redirect on Shopify’s side with a no_cookies_from_redirect=1 query parameter.
Resolution:
The issue was resolved by fixing how the Vercel Commerce starter stores and retrieves Storefront API checkout URLs in cookies, ensuring proper character encoding.
Additional Resources:
A community member (Sejiux) published a Medium article titled “How to resolve checkout redirection in shopify headless” with detailed solution steps for others experiencing similar 404 errors during checkout attempts with Vercel Commerce.