netresearch / dhl-module-ui

Module for providing the presentation layer within the Magento application for custom functionality
Open Software License 3.0
3 stars 0 forks source link

Cannot read property 'quoteData' of undefined Dhl_Ui/js/mixin/checkout/ship-to-address #7

Closed parlt closed 3 years ago

parlt commented 3 years ago

This is related to https://github.com/netresearch/dhl-module-ui/issues/2 and https://github.com/netresearch/dhl-module-ui/issues/3 and is definitely a bug. Is in the require js of the DHL_UI Module

'Magento_Customer/js/model/customer/address': { 'Dhl_Ui/js/mixin/checkout/ship-to-address': true },

in Dhl_Ui/js/mixin/checkout/ship-to-address has a dependency to the "Magento_Checkout/js/model/quote" Magento_Checkout/js/model/quote expects a checkout config.

A Checkout Config exists only in Cart, Checkout etc. If we f.e. log in as a customer and try to modify or add an address we have the error If we use addtional Modules wich use Magento_Customer/js/model/customer/address in a Non Checkout / Cart Context we have the error. Cannot read property 'quoteData' of undefined

It seems for me completely wrong to create a global dependency between a customer address model to a checkout quote model. So please fix it and inject your code only in checkout scope and not on all pages with an address model or catch the situation where a checkout config doesn't exists

powli commented 3 years ago

@parlt thank you for your thorough analysis of the problem. We will investigate further and try to find a solution to the problem.

Internal reference: DHLGW-1074

mam08ixo commented 3 years ago

Fixed in version 1.2.3