Magento – magento 2.3.2: checkout Uncaught TypeError: Cannot read property ‘getCacheKey’ of null

billing-addressmagento2.3.2onepage-checkout

I have an issue on checkout page and we are getting below error on console. It looks like address object is not loaded correctly on quote object and we are getting different error each time.

i know here someone asked this question but nothing find proper solution

billing-address.min.js:1 Uncaught TypeError: Cannot read property 'getCacheKey' of null
    at UiClass.<anonymous> (billing-address.min.js:1)
    at Function.notifySubscribers (knockout.min.js:133)
    at Function.valueHasMutated (knockout.min.js:149)
    at Object.observable [as billingAddress] (knockout.min.js:143)
    at select-billing-address.min.js:2
    at checkout-data-resolver.min.js:14
    at Function._.some._.any (underscore.min.js:15)
    at Function.some (observable_array.min.js:4)
    at Object.applyBillingAddress (checkout-data-resolver.min.js:14)
    at Object.resolveBillingAddress (checkout-data-resolver.min.js:13)

ut

Any help would be appreciated.

Thanks.

Best Answer

Try this -

Change the line 86 of the following file:

vendor/magento/module-checkout/view/frontend/web/js/view/billing-address.js

It should be changed from

if (quote.isVirtual()) {

to

if (quote.isVirtual() || !quote.shippingAddress()) {

Run these commends after making the above change.

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush

Now check on the site, Hope it will work!

Please note that you can override this file in your custom module or extension. If you don't want to make these changes on Magento core file.

Ref : https://github.com/magento/magento2/issues/24131