Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'length' of undefined #18

Open
Amank-root opened this issue May 4, 2021 · 2 comments
Open

TypeError: Cannot read property 'length' of undefined #18

Amank-root opened this issue May 4, 2021 · 2 comments

Comments

@Amank-root
Copy link

error

can you guys plz help me with this??
errosame

@Amank-root Amank-root changed the title Cannot read property lenght TypeError: Cannot read property 'length' of undefined May 4, 2021
@Anas1300
Copy link

trying using it this way, i dont understand why .length does'nt work either.

const isEmpty = () => {
        if (cart.line_items === 0) {
            return true
        } else {
            return false
        }
    }

@Pooreffects
Copy link

If stuck, just look for any response changes from the commerce API call.
Here's how I solved it:
{!cart.line_items ? ShowEmptyCart() : ShowFilledCart()}
or
{!cart.line_items ? : }

Happy Coding! ☺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants