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

Checkout - Fix JS error Cannot read property 'quoteData' of undefined #18503

Conversation

ihor-sviziev
Copy link
Contributor

@ihor-sviziev ihor-sviziev commented Oct 10, 2018

Description

Sometimes after going to checkout page we have infinite loading indicator that caused by JS error
Cannot read property 'quoteData' of undefined.

This issue happened because quote.js file using window.checkoutConfig, that inserted directly into page, but sometimes quote.js component initialization executes first.

quoteData = window.checkoutConfig.quoteData,
basePriceFormat = window.checkoutConfig.basePriceFormat,
priceFormat = window.checkoutConfig.priceFormat,
storeCode = window.checkoutConfig.storeCode,
totalsData = proceedTotalsData(window.checkoutConfig.totalsData),

This change adding waiting when dome ready and window.checkoutConfig is already available

Fixed Issues (if relevant)

N/A

Related issues

  1. Magento 2.2.3 TypeErrors Cannot read property 'quoteData' / 'storecode' / 'sectionLoadUrl' of undefined  #14412: Magento 2.2.3 TypeErrors Cannot read property 'quoteData' / 'storecode' / 'sectionLoadUrl' of undefined

Manual testing scenarios

  1. Add some product to the cart
  2. Go to checkout page
  3. See console errors

Note: This issue reproducing quote small amount of times

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@rodrigowebjump
Copy link
Member

@ihor-sviziev Thanks for your PR.

I couldn't reproduce the issue. Please, could you send more details.

@ihor-sviziev
Copy link
Contributor Author

ihor-sviziev commented Oct 15, 2018

Hi @rodrigowebjump,
This issue reproducing for me small amount of times, but sometimes it appears. Maybe probability of reproducing increased by using mageplaza one step checkout, but issue happens in core file.
I think it happens when CDN for JS files is used and all js files are getting from browser cache.
Also look at related issue, on screenshot I also seen this issue

@ihor-sviziev
Copy link
Contributor Author

ihor-sviziev commented Nov 21, 2018

Hi @rodrigowebjump @mpchadwick @VladimirZaets ,
Please review my last comment. Not only me got this issue, and it's really critical to fix it because it's braking checkout.

@ihor-sviziev ihor-sviziev reopened this Nov 21, 2018
@mpchadwick
Copy link
Contributor

@ihor-sviziev this PR was not intentionally closed. We had referenced in in a PR to a private repo which I merged (we're experiencing the same issue on a client site). That seems to have closed this PR unintentionally. Seems like a GitHub bug, but sorry about it. And yes, I agree with you, this issue is critical.

@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko, thank you for the review.
ENGCOM-3849 has been created to process this Pull Request

Copy link
Member

@rodrigowebjump rodrigowebjump left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ihor-sviziev

Thanks for your contribution.

@magento-engcom-team
Copy link
Contributor

Hi @rodrigowebjump, thank you for the review.
ENGCOM-3849 has been created to process this Pull Request

@ghost
Copy link

ghost commented Feb 25, 2019

Hi @ihor-sviziev, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@t-eichmann
Copy link

Is there any reason why this fix still is only present in 2.3-develop and not in 2.3.1?

@ihor-sviziev
Copy link
Contributor Author

Hi @t-eichmann,
This PR was assigned to milestone 2.3.2, so it should be included into release 2.3.2

@ihor-sviziev ihor-sviziev deleted the fix-cannot-read-property-quoteData-of-undefined branch March 28, 2019 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants