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

Uncaught (in promise) TypeError: Cannot read property 'physicalItems' of undefined: cart.js:71 #148

Open
Mikhail-MM opened this issue Dec 4, 2020 · 7 comments

Comments

@Mikhail-MM
Copy link

Hello,

I've been seeing this error on multiple Cornerstone themes.

This happens on page-load, I assume this is happening when you land on a BC page and have an empty cart, potentially related to the theme checking for the quantity in cart to update the count-pill.

This is the error that shows up in console:

cart.js:71 

Uncaught (in promise) TypeError: Cannot read property 'physicalItems' of undefined
    at cart.js:71
    at cart.js:44
    at request.js:124

Origin of the error is /stencil-utils/src/api/cart.js

Any ideas on how to resolve, is this a problem with a cornerstone version, or stencil utils version, or both?

@jairo-bc
Copy link
Contributor

jairo-bc commented Dec 4, 2020

Hi @Mikhail-MM,

This is currently fixed in #137. And this will be released with next version 6.7.0 (#147) of stencil-utils

@Mikhail-MM
Copy link
Author

@jairo-bc Thanks for the quick response,

Is this related to this PR in Cornerstone (bigcommerce/cornerstone#1920)?

I've seen some issues on Chrome local development where adding to cart + going to the cart page will result in an empty cart, trying to make sense of why this is happening, I'm worried that there is a de-sync between the CartID returned by Stencil Utils & The CartID injectd by BigCommerce Context

@jairo-bc
Copy link
Contributor

jairo-bc commented Dec 4, 2020

@Mikhail-MM That PR is mostly about cleaning up the cornerstone. The fix is already applied on the cornerstone, it's only requires the newer version of stencil utils that will come up early next week

@Mikhail-MM
Copy link
Author

@jairo-bc Do you know which version number of cornerstone/ which Pull Request this was patched in on cornerstone?

We have some older client themes that are running into this and we may need to do some work on our end to avoid issues.

@rowleyaj
Copy link

rowleyaj commented Dec 5, 2020

@Mikhail-MM cornerstone will need a new release, after the stencil-utils release is done, before we're able to use this fix.

@Mikhail-MM
Copy link
Author

@rowleyaj I see, thank you. I'll keep an eye out on the changelog so that we can merge the updates in selectively.

I'm still trying to find the best way to keep our custom themes in sync with latest cornerstone updates.

Once we begin to work on a theme for a client using a any version of cornerstone our development tends to branch off completely.

We're still trying to find a way to be able to automatically merge critical changes into Cornerstone using GitHub without seeing merge conflicts

@jairo-bc
Copy link
Contributor

jairo-bc commented Dec 7, 2020

@Mikhail-MM stencil-utils 6.7.0 was released to npm.

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