I’m having trouble with my product documentation setup using metaobjects. Everything was working fine until I added a custom domain to my Shopify store.
I created a metaobject for product docs that has both file upload and URL fields. Here’s my liquid code:
I tried switching from file fields to URL fields thinking it might help, but same issue. The links just don’t respond to clicks anymore after connecting my custom domain. Has anyone seen this before?
check your browser console for any CORS errors when clicking those links. custom domains often mess with shopify’s file permissions and you might need to contact support to refresh the CDN mappings for your new domain. i had similar issue last month and shopify had to manually sync the file access permissions on their end.
This looks like a classic CDN caching issue combined with domain propagation delays. When you add a custom domain, Shopify needs time to update all the file serving endpoints across their infrastructure. The fact that your URLs are rendering correctly but not functioning suggests the domain mapping is incomplete on the backend. I’ve seen this take anywhere from 24-72 hours to fully resolve, even though Shopify shows the domain as connected. Try accessing one of those file URLs directly in a new browser tab to see if you get a 404 or timeout error. If the direct URLs fail, the issue is definitely on Shopify’s side and you’ll need to wait for their CDN to catch up. You can also try clearing your browser cache and testing in incognito mode to rule out local caching problems. Sometimes forcing a hard refresh of the product pages helps trigger the proper URL resolution.
I encountered something similar when migrating to a custom domain last year. The issue appears to be related to mixed URL formats in your rendered HTML. Notice how your external_link is generating a full cdn.shopify.com URL while the file_url filter is producing a protocol-relative URL starting with just //mystore.com. This inconsistency can cause browsers to block the requests, especially if there are HTTPS/HTTP conflicts. Try adding https: before the protocol-relative URLs or use the asset_url filter instead of file_url for your attachments. Also worth checking your custom domain SSL certificate status in Shopify admin, as incomplete SSL setup often breaks file serving even when the URLs appear correct in inspector.
Had this exact problem about 6 months ago when we switched to our custom domain. The root cause is usually CDN configuration issues between Shopify’s file serving and your new domain setup. What fixed it for me was going into the Shopify admin under Online Store > Domains and running the domain verification again, even though it showed as connected. There’s often a delay in propagating the file access permissions across Shopify’s CDN network after domain changes. Also check if you have any content security policy headers or browser extensions blocking cross-domain requests. The protocol-relative URLs can be problematic too - I ended up using {{ doc.attachment | file_url | prepend: 'https:' }} to force HTTPS protocol explicitly. Give the domain verification a refresh first though, that solved 90% of my file access issues after custom domain setup.