本地Wampserver环境下Snipcart出现domain-crawling-failed错误,data-item-url配置问题排查求助
I’ve been testing a product payment flow locally using Wampserver, but I keep hitting a 'domain-crawling-failed' error during the payment confirmation step. Here’s what I’ve already done:
- Added
localhostas the default domain in the Snipcart dashboard, plus the corresponding subdomain (screenshot shows the domain list includes these entries) - My product page with the purchase buttons is at
http://localhost/Site/boutique
Below is the relevant HTML code for the product list:
<ul id="Product-List"> <li class="product-item shown"> <img src="assets/word.png"> <div class="product-description"> <h1>Word Guide Complet</h1> </div> <div class="product-pay"> <h2>39,99 €</h2> <button class="buy-button snipcart-add-item" data-item-id="word" data-item-price="39.99" data-item-url="http://localhost/Site/boutique" data-item-description="Le guide complet de Word" data-item-image="assets/word.png" data-item-name="Word Guide Complet"> Ajouter au panier </button> </div> </li> <li class="product-item shown"> <img src="assets/excel.png"> <div class="product-description"> <h1>Excel Guide Complet</h1> </div> <div class="product-pay"> <h2>39,99 €</h2> <button class="buy-button snipcart-add-item" data-item-id="excel" data-item-price="39.99" data-item-url="http://localhost/Site/boutique" data-item-description="Le guide complet de Excel" data-item-image="assets/excel.png" data-item-name="Excel Guide Complet"> Ajouter au panier </button> </div> </li> <li class="product-item shown"> <img src="assets/powerpoint.png"> <div class="product-description"> <h1>Powerpoint Guide Complet</h1> </div> <div class="product-pay"> <h2>39,99 €</h2> <button class="buy-button snipcart-add-item" data-item-id="powerpoint" data-item-price="39.99" data-item-url="http://localhost/Site/boutique" data-item-description="Le guide complet de Powerpoint" data-item-image="assets/powerpoint.png" data-item-name="Powerpoint Guide Complet"> Ajouter au panier </button> </div> </li> </ul>
Likely Causes & Fixes
1. Snipcart Can’t Reach Your Local localhost Instance
The biggest issue here is that localhost is a loopback address only accessible on your own machine—Snipcart’s servers (which crawl your product page to validate items) can’t reach it directly.
Fix: Use a local tunneling tool like ngrok to expose your Wampserver to the public internet:
- Download ngrok and run
ngrok http 80(adjust the port if you changed Wampserver’s default port) - Copy the temporary public URL ngrok generates (e.g.,
xyz123.ngrok.io) - Add this URL to your Snipcart dashboard’s allowed domains (just the domain part, no
http://) - Update the
data-item-urlattribute on your buy buttons to use the ngrok URL (e.g.,http://xyz123.ngrok.io/Site/boutique) - Test the payment flow by accessing your site via the ngrok URL instead of
localhost
2. Domain Configuration Mistakes in Snipcart
Double-check your Snipcart domain settings:
- Ensure you’re adding domains without the protocol (e.g.,
localhostinstead ofhttp://localhost) - If you’re using a subdomain locally (like
site.localhost), make sure it’s exactly matched in the Snipcart dashboard - Confirm there are no typos in the domain entries (extra spaces, missing dots, etc.)
3. Local Server Access Restrictions
Wampserver might be configured to block external requests:
- Open your Apache
httpd.conffile and verify the following settings allow external access:AllowOverride All Require all granted - Try accessing your product page from another device on the same network using your local IP (e.g.,
http://192.168.1.100/Site/boutique). If it doesn’t load, adjust your Wampserver firewall/access rules.
4. Firewall/Antivirus Blocking
Your local firewall or antivirus might be preventing Snipcart’s crawlers from reaching your Wampserver:
- Temporarily disable your firewall/antivirus and test the payment flow. If the error goes away, add an exception for Wampserver’s Apache service in your security software.
内容的提问来源于stack exchange,提问作者KenTay7

