discolabs / cartjs

A Javascript library to power cart management for Shopify themes.
https://cartjs.org
MIT License
478 stars 85 forks source link

Non-rivets build triggers ReferenceError #189

Closed tywayne closed 3 years ago

tywayne commented 4 years ago

An attempt to read a rivets variable that has never been defined in the cartjs only build causes an error, not allowing anything else to work.

Uncaught ReferenceError: rivets is not defined

Steps to reproduce:

  1. Install /dist/cart.min.js into a document
  2. Open developer console

Basic reproduction

Codepen here

sebszocinski commented 4 years ago

Having the same issue here, is there a fix for this? i'm importing rivets and then CartJS directly below it:

import $ from 'jquery'
import rivets from 'rivets'
import CartJS from 'shopify-cartjs'

This gives me rivets is not defined in my console log.

However if I take out CartJS and do a console.log(rivets) i'm getting rivets object logging....

gavinballard commented 3 years ago

Fix released in v1.1.0. Thanks @tywayne and @sebszocinski!