A plain script runs before Smootify has loaded; change its type to smootify-load so it runs right after.
The symptom. An app’s code, pasted in the site’s custom code, does nothing or throws errors, often around the cart.
Why. Smootify loads as a module, after plain scripts. A snippet that calls the cart (/cart.js) or wraps fetch runs too early.
The fix. Keep the snippet as it is and change only its type:
<script type="smootify-load">
// the app's code
</script>Smootify runs it right after it has loaded. For your own code, use window.Smootify.push instead.