cancel
Showing results for 
Search instead for 
Did you mean: 

Java Script Error in Chrome in Magento 2.4 (Uncaught TypeError in email.js line 165)

Highlighted

Java Script Error in Chrome in Magento 2.4 (Uncaught TypeError in email.js line 165)

Hi 

The magento is throwing below javascript error  and thats stop checkout page to load forever on checkout 

Step to products 

1. Add item to cart 

2. Proceed to Checkout 

3. Add email address and try to login 

The spinning wheen is running forever  and only get the page back on refresh, getting below error in chrome 

Uncaught TypeError: Cannot read property 'check' of undefined

    at UiClass.validateEmail (email.js:165)

    at UiClass.emailHasChanged (email.js:90)

    at setNested (objects.js:43)

    at Object.nested (objects.js:117)

    at UiClass.set (element.js:305)

    at updateValue (links.js:80)

    at Function.notifySubscribers (knockout.js:1320)

    at Function.valueHasMutated (knockout.js:1538)

    at UiClass.observable [as email] (knockout.js:1504)

    at setNested (objects.js:43)

 

 

3 REPLIES 3
Highlighted

Re: Java Script Error in Chrome in Magento 2.4 (Uncaught TypeError in email.js line 165)

HI There,

 

same issue seen in 2.4.1

 

Uncaught TypeError: Cannot read property 'check' of undefined
at UiClass.validateEmail (email.js:165)

 

is there any known issue and if so, any solution for this?

 

THanks in advance

Highlighted

Re: Java Script Error in Chrome in Magento 2.4 (Uncaught TypeError in email.js line 165)

open your browser console and check 

jQuery("form[data-role=email-with-possible-login]").length

this should result in 1 

 

or if this return 0 then you need to check your theme and 3rd party module 

it may be possible that the email.html has been overridden in theme or 3rd party module 

you need to check that and update the form with the same data-role same as defined 

<form class="form form-login" data-role="email-with-possible-login"
      data-bind="submit:login"
      method="post">

 

kindly Accept as Solution if this works for you and give Kudos Smiley Happy 

Highlighted

Re: Java Script Error in Chrome in Magento 2.4 (Uncaught TypeError in email.js line 165)

HI amitsamsukha,

 

as i'm a bi newbie to magento, one thing i can confirm:

jQuery("form[data-role=email-with-possible-login]").length

is resulting in 0.

As i'm doing the stuff in developer mode, could'nt find any third-party module which is explicitly replacing html.

Howver i know ther is one module which is initiating before this error (local DHL module). This one is however not using an HTM ltemplate but .js files.

 

Any hint what to looking for?

Best regards