klaviyo / magento2-klaviyo

38 stars 51 forks source link

TypeError: customerData.getInitCustomerData is not a function #196

Open Berman59 opened 2 years ago

Berman59 commented 2 years ago

... from "Klaviyo_Reclaim/js/customer.min.js". Getting this error on a Magento 2.3.7 test environment. I don't see getInitCustomerData in Magento 2.3.7's customer-data.js, is it because this version is not supported anymore...?

fidellakis-coolibar commented 2 years ago

Also seeing this error running M2.4.3-p1 Screen Shot 2022-08-03 at 11 44 33 AM

diyontheweb commented 2 years ago

Confirm also seeing this on 2.3.7

Jaeto commented 2 years ago

For the comments above, can you also supply which version of the Klaviyo extension you are using?

diyontheweb commented 2 years ago

Hi @Jaeto. We have tried 4.0.5 and 4.0.2 on Magento 2.3.7.

fidellakis-coolibar commented 2 years ago

We fixed this by ensuring any theme overrides from Magento_Customer module has all methods from extending class.

guentur commented 2 years ago

Hi. I have created a module for fixing this issue.

https://github.com/guentur/FixKlaviyoUndefinedFunction

guentur commented 2 years ago

@fidellakis-coolibar Have you found getInitCustomerData() function in your Magento installation? I noticed there is not any modules that add mentioned function.

fidellakis-coolibar commented 2 years ago

@guentur check vendor/magento/module-customer/view/frontend/web/js/customer-data.js. It's there for me. What version of Magento are you running.

guentur commented 2 years ago

@fidellakis-coolibar My project uses Magento 2.3.4. I have found there is not required function (getInitCustomerData()) in vendor/magento/module-customer/view/frontend/web/js/customer-data.js. I will change my module to add this function instead of just removing calling this function in Klaviyo module