magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.53k stars 9.31k forks source link

M2.2.9 : Uncaught TypeError with the `MSP_Recaptcha` module #23518

Closed kanduvisla closed 5 years ago

kanduvisla commented 5 years ago

Preconditions

  1. Magento 2.2.9
  2. Default installation with 1 example product
  3. customer/captcha/enable is set to 0. (Customer captcha is disabled)

Steps to reproduce

Go to the product detail page.

Expected result

No JavaScript errors should be present.

Actual result

The following JavaScript error is present:

reCaptcha.js:70 Uncaught TypeError: Cannot read property 'lang' of undefined
    at UiClass._loadApi (reCaptcha.js:70)
    at UiClass.initialize (reCaptcha.js:39)
    at UiClass.initialize (wrapper.js:109)
    at new UiClass (class.js:49)
    at Object.initComponent (layout.js:137)
    at fire (jquery.js:3232)
    at Object.fireWith [as resolveWith] (jquery.js:3362)
    at Object.deferred.<computed> (jquery.js:3461)
    at fire (jquery.js:3232)
    at Object.fireWith [as resolveWith] (jquery.js:3362)

I believe this error is triggered by the MSP_Recaptcha module, that is included and enabled by a default installation. This module tries to configure the reCaptcha.js component on the frontend without credentials (since the module is disabled in the backend).

m2-assistant[bot] commented 5 years ago

Hi @kanduvisla. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@kanduvisla do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?


hostep commented 5 years ago

Indeed, I've noticing the same problem on Magento 2.3.2 btw, didn't look into the details yet.

engcom-Bravo commented 5 years ago

Hello, @kanduvisla. Indeed we managed to reproduce Your issue on 2.3.2 as @hostep says he did, but we were not able to do that on 2.3-develop instance. Could You please try to reproduce Your issue on a vanilla 2.3-develop installation and tell us the results. Thank You.

hostep commented 5 years ago

@engcom-Bravo: MSP_Recaptcha module isn't getting installed when cloning the git repo, you need to install Magento using composer for it to being installed.

Or should we open an issue on https://github.com/magento/magespecialist_ReCaptcha ?

Update: looks like somebody already reported it and many people in there replying that the issue is back in 2.3.2: https://github.com/magento/magespecialist_ReCaptcha/issues/11

So we should close this issue here on the M2 repo I guess.

engcom-Bravo commented 5 years ago

Yes @hostep, You are right. I looked at my 2.3.2 version instance where I succed with reproduction and yes It is the one installed via composer (Somehow forgot about that). So closing this issue here and referencing it there is the right decision. Thank You.

Bowens20832 commented 5 years ago

I am able to reproduce on a vanilla install of Magento 2.3.2.

There is also an existing open issue on MSP Recaptcha repo related to this. https://github.com/magento/magespecialist_ReCaptcha

The error occurs here: https://github.com/magento/magespecialist_ReCaptcha/blob/8280c2ae20c259cd6ecfd6ea6d1c07846998d381/view/frontend/web/js/reCaptcha.js#L69

the settings variable seems to be undefined when element.src is called. I would recommend a constructor for the settings variable.

ladle3000 commented 5 years ago

Same issue on 2.3.2 product pages

magecommerce commented 5 years ago

Same issue on 2.3.2 product pages

ladle3000 commented 5 years ago

I think this is tied to PayPal's dependence of this module that was added. If I turn on PayPal in settings I don't see this error in console and I see a new big yellow PayPal looking buy now button on my product pages that I've not seen in prior releases.