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

Error - is not a function: require(['domReady!'], function() #238

Open
jesperbrejning opened this issue Mar 14, 2023 · 4 comments
Open

Error - is not a function: require(['domReady!'], function() #238

jesperbrejning opened this issue Mar 14, 2023 · 4 comments

Comments

@jesperbrejning
Copy link

Environment details

PHP version: 8.1
Magento version: 2.4.6
Klaviyo extension version: 4.0.10
Anything else that would help a developer reproduce the bug?

Steps to reproduce

After upgrade to Magento version 2.4.6 an error on this function :

require(['domReady!'], function()

Expected result

No errors in Google console

Actual result

Error in Google Console: require(['domReady!'], function()

Additional information

No response

@jorgb90
Copy link

jorgb90 commented Mar 21, 2023

Same here. Updated to Magento 2.4.6 and Klaviyo integration stopped working. Reauthorize is working, but still reporting error after it.

Don't know if the issues are related. @jesperbrejning I think this isn't API related or is it?

Update

I found my problem which can be checked here magento/magento2#37278

@jesperbrejning
Copy link
Author

I don't think it's the same error I see, because we don't have special characters in the sku. But we do have special characters in ex. the "Name". Could that cause the error?

script text="text/javascript">
require(['domReady!'], function () {
var _learnq = window._learnq || [];
_learnq.push(['track', 'Viewed Product', {"ProductID":"97679","Name":"Tryk mig p\u00e5 maven - Dyr p\u00e5 g\u00e5rden fra Boldens Forlag","SKU":"9788772053554","URL":"https://www.babygear.dk/tryk-mig-pa-maven-dyr-pa-garden-fra-boldens-forlag.html","Price":"59.00","FinalPrice":"59.00","Categories":["Billedb\u00f8ger","Bestsellers"],"ImageURL":"https://www.babygear.dk/media/catalog/product/cache/44d872830c388882e3e32a2a33f56854/9/7/9788772053554.jpg"}]);
_learnq.push(['trackViewedItem', {"Title":"Tryk mig p\u00e5 maven - Dyr p\u00e5 g\u00e5rden fra Boldens Forlag","ItemId":"97679","Url":"https://www.babygear.dk/tryk-mig-pa-maven-dyr-pa-garden-fra-boldens-forlag.html","Categories":["Billedb\u00f8ger","Bestsellers"],"Metadata":{"Price":"59.00"},"ImageURL":"https://www.babygear.dk/media/catalog/product/cache/44d872830c388882e3e32a2a33f56854/9/7/9788772053554.jpg"}]);
});
</script>

@cykolln
Copy link
Contributor

cykolln commented Apr 7, 2023

@jesperbrejning Can you please specify the error you are seeing on the console? Special characters should not cause issues in onsite tracking.

@jesperbrejning
Copy link
Author

We are seeing this error on all product view pages.

The error in console is the following:

Uncaught ReferenceError: require is not defined
at pixi-serie-bondegardens-dyr-med-sebastian-klein.html:8466:3
(anonym) @ pixi-serie-bondegardens-dyr-med-sebastian-klein.html:8466

With reference to this function in the code:

<script text="text/javascript"> require(['domReady!'], function () { var _learnq = window._learnq || []; _learnq.push(['track', 'Viewed Product', {"ProductID":"68475","Name":"Pixi-bog - Bondeg\u00e5rdens dyr m. Sebastian Klein (1 bog, ass.)","SKU":"9788711698518","URL":"https:\/\/www.babygear.dk\/pixi-serie-bondegardens-dyr-med-sebastian-klein.html","Price":"15.00","FinalPrice":"15.00","Categories":["Pixib\u00f8ger"],"ImageURL":"https:\/\/www.babygear.dk\/media\/catalog\/product\/cache\/44d872830c388882e3e32a2a33f56854\/9\/7\/9788711698518.jpg"}]); _learnq.push(['trackViewedItem', {"Title":"Pixi-bog - Bondeg\u00e5rdens dyr m. Sebastian Klein (1 bog, ass.)","ItemId":"68475","Url":"https:\/\/www.babygear.dk\/pixi-serie-bondegardens-dyr-med-sebastian-klein.html","Categories":["Pixib\u00f8ger"],"Metadata":{"Price":"15.00"},"ImageURL":"https:\/\/www.babygear.dk\/media\/catalog\/product\/cache\/44d872830c388882e3e32a2a33f56854\/9\/7\/9788711698518.jpg"}]); }); </script>

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