Skip to content

mcaptcha usage creates javascript error #33658

Closed
@CaveManon

Description

@CaveManon

Description

When enabling mCaptcha on a site and going to the registration page, the following Javascript error appears
JavaScript promise rejection: r.default is not a function. Open browser console to see more details.

The console points to the following line of code as the problem area:

      // @ts-expect-error
      mCaptcha.default({
        siteKey: {
          instanceUrl: new URL(instanceURL),
          key: siteKey,
        },
      });

with the error being caught (in promise) TypeError: r.default is not a function

Relevant part of app.ini here:

ENABLE_CAPTCHA = true
MCAPTCHA_SITEKEY = ***
MCAPTCHA_SECRET =  ***
CAPTCHA_TYPE = mcaptcha
MCAPTCHA_URL= https:// ***/widget/?sitekey=***

Gitea Version

1.23.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

Not relevant; issue is in Web UI.

Screenshots

Image

Git Version

git version 2.39.5

Operating System

Debian 6.1.124-1

How are you running Gitea?

Downloading .deb package using apt from https://packaging.gitlab.io/gitea

Database

PostgreSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions