Maximum call stack size exceeded

Hi, i face this error when clicking on payment button:

snipcart.js:16 RangeError: Maximum call stack size exceeded
    at String.match (<anonymous>)
    at ee (snipcart.js:16:11321)
    at ne (snipcart.js:16:11398)
    at re (snipcart.js:16:11449)
    at Xt (snipcart.js:16:10884)
    at a (snipcart.js:16:32620)
    at ur (snipcart.js:16:32683)
    at cr (snipcart.js:16:32337)
    at t._init (snipcart.js:16:34635)
    at new e (snipcart.js:16:35907)
se @ snipcart.js:16

And Snipcart freeze. Have you an idea about this ?
Thanks

Hi,
Is there still support ?

had this and fixed it by upgrading store version

Thank you very much. I upgrade to 3.4.0.

I tried to use the new integration script and pasted it:

	<script>
	  window.SnipcartSettings = {
	    publicApiKey: "MYAPIKEY",
	    loadStrategy: "on-user-interaction",
	    modalStyle: "side",
	    timeoutDuration: 1000,
	  };
	
	 (function(){var c,d;(d=(c=window.SnipcartSettings).version)!=null||(c.version="3.0");var s,S;(S=(s=window.SnipcartSettings).currency)!=null||(s.currency="usd");var l,p;(p=(l=window.SnipcartSettings).timeoutDuration)!=null||(l.timeoutDuration=2750);var w,u;(u=(w=window.SnipcartSettings).domain)!=null||(w.domain="cdn.snipcart.com");var m,g;(g=(m=window.SnipcartSettings).protocol)!=null||(m.protocol="https");var f,v;(v=(f=window.SnipcartSettings).loadCSS)!=null||(f.loadCSS=!0);var E=window.SnipcartSettings.version.includes("v3.0.0-ci")||window.SnipcartSettings.version!="3.0"&&window.SnipcartSettings.version.localeCompare("3.4.0",void 0,{numeric:!0,sensitivity:"base"})===-1,y=["focus","mouseover","touchmove","scroll","keydown"];window.LoadSnipcart=o;document.readyState==="loading"?document.addEventListener("DOMContentLoaded",r):r();function r(){window.SnipcartSettings.loadStrategy?window.SnipcartSettings.loadStrategy==="on-user-interaction"&&(y.forEach(function(t){return document.addEventListener(t,o)}),setTimeout(o,window.SnipcartSettings.timeoutDuration)):o()}var a=!1;function o(){if(a)return;a=!0;let t=document.getElementsByTagName("head")[0],n=document.querySelector("#snipcart"),i=document.querySelector('src[src^="'.concat(window.SnipcartSettings.protocol,"://").concat(window.SnipcartSettings.domain,'"][src$="snipcart.js"]')),e=document.querySelector('link[href^="'.concat(window.SnipcartSettings.protocol,"://").concat(window.SnipcartSettings.domain,'"][href$="snipcart.css"]'));n||(n=document.createElement("div"),n.id="snipcart",n.setAttribute("hidden","true"),document.body.appendChild(n)),$(n),i||(i=document.createElement("script"),i.src="".concat(window.SnipcartSettings.protocol,"://").concat(window.SnipcartSettings.domain,"/themes/v").concat(window.SnipcartSettings.version,"/default/snipcart.js"),i.async=!0,t.appendChild(i)),!e&&window.SnipcartSettings.loadCSS&&(e=document.createElement("link"),e.rel="stylesheet",e.type="text/css",e.href="".concat(window.SnipcartSettings.protocol,"://").concat(window.SnipcartSettings.domain,"/themes/v").concat(window.SnipcartSettings.version,"/default/snipcart.css"),t.prepend(e)),y.forEach(function(h){return document.removeEventListener(h,o)})}function $(t){!E||(t.dataset.apiKey=window.SnipcartSettings.publicApiKey,window.SnipcartSettings.addProductBehavior&&(t.dataset.configAddProductBehavior=window.SnipcartSettings.addProductBehavior),window.SnipcartSettings.modalStyle&&(t.dataset.configModalStyle=window.SnipcartSettings.modalStyle),window.SnipcartSettings.currency&&(t.dataset.currency=window.SnipcartSettings.currency),window.SnipcartSettings.templatesUrl&&(t.dataset.templatesUrl=window.SnipcartSettings.templatesUrl))}})();
	</script>

ā€¦ And this XHR service (https://app.snipcart.com/api/cart) return error 500 and then stop Snipcart working.

message: "An error has occurred."

So iā€™m still using old <script async src="https://cdn.snipcart.com/themes/v3.4.0/default/snipcart.js"></script> to make it works.

Do you have this issue too ?

Hey @Fletcher,

Looks like you had a custom template with no closing tag (two opening tags).

<shipping-completed context="<string>">
<shipping-completed>

This was causing the issue when trying to display it.

Thank you very much !
Sometimes, copy-paste is hell !
:wink:

1 Like