# React javascript errors within Auth0 code using Auth Lock

**URL:** <https://community.auth0.com/t/react-javascript-errors-within-auth0-code-using-auth-lock/189470>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [July 21, 2025, 4:27pm UTC](https://community.auth0.com/t/react-javascript-errors-within-auth0-code-using-auth-lock/189470 "2025-07-21T16:27:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JamesSeabrook-MRM](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jamesseabrook-mrm/32/75814_2.png) [@JamesSeabrook-MRM](https://community.auth0.com/u/JamesSeabrook-MRM)\
**Post date:** [July 21, 2025, 4:27pm UTC](https://community.auth0.com/t/react-javascript-errors-within-auth0-code-using-auth-lock/189470/1 "2025-07-21T16:27:58Z")

</div>

I’ve recently upgraded from Auth-lock `11.27.0` to `13.0.0`. I’ve double checked our implementation and made all the necessary configuration changes within the JS code. Its being used in a vanilla JS environment and is a really simple implementation.

```JS
const options = {
            avitarUrl: '', /* Was previously avitar: null*/
            container: this.containerId,
            allowSignUp: this.showSignUp,
            allowLogin: this.showLogin,
            auth: {
                redirect_uri: this.redirectUrl, /*Updated from redirectUrl*/
                state: this.destinationUrl /*Updated from params: { state: this.destinationUrl }*/
            },
            language: this.langCode,
            allowShowPassword: true,
            showTerms: true,
            mustAcceptTerms: true,
            additionalSignUpFields: [
                {
                    name: 'given_name',
                    placeholder: this.firstNameText,
                    storage: 'root'
                },
                {
                    name: 'family_name',
                    placeholder: this.lastNameText,
                    storage: 'root'
                },
                {
                    type: 'checkbox',
                    name: 'newsletter',
                    prefill: 'false',
                    placeholder: this.newsletterText
                },
                {
                    name: 'locale',
                    value: this.langCode,
                    placeholder: this.langCode,
                    type: 'hidden'
                },
                {
                    name: 'language_context',
                    value: this.langContext,
                    placeholder: this.langContext,
                    type: 'hidden'
                }
            ]
        };
this.lock = new Auth0Lock(this.authClientId, this.authDomain, options);
this.lock.show();

```

Its at the point of `this.lock.show()` that we get a string of javascript errors relating to errors in React code. I’ve tried a few things around changing versions but always returning to the same error.

This is all running on node version `20.17.0`

Is there something I’m missing from the configuration?

This is the error list I’m getting:

````JS
Uncaught Error: Expected ref to be a function, an object returned by React.createRef(), or undefined/null.
    at markRef (vendors-node_modules…e.bundle.js:8862:17)
    at updateClassComponent (vendors-node_modules…me.bundle.js:9454:7)
    at beginWork (vendors-node_modules….bundle.js:10545:13)
    at runWithFiberInDEV (vendors-node_modules…e.bundle.js:1529:30)
    at performUnitOfWork (vendors-node_modules….bundle.js:15141:22)
    at workLoopSync (vendors-node_modules….bundle.js:14965:41)
    at renderRootSync (vendors-node_modules….bundle.js:14945:11)
    at performWorkOnRoot (vendors-node_modules….bundle.js:14471:44)
    at performWorkOnRootViaSchedulerTask (vendors-node_modules…e.bundle.js:16225:7)
    at MessagePort.performWorkUntilDeadline (vendors-node_modules….bundle.js:26834:48)```

Any help would be greatly appreciated.
````

---

<div class="post-metadata">

**Author:** ![vlad.murarasu](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vlad.murarasu/32/72793_2.png) [@vlad.murarasu](https://community.auth0.com/u/vlad.murarasu)\
**Post date:** [July 24, 2025, 7:27pm UTC](https://community.auth0.com/t/react-javascript-errors-within-auth0-code-using-auth-lock/189470/3 "2025-07-24T19:27:45Z")

</div>

Hi @JamesSeabrook-MRM

Welcome to the Auth0 Community!

Several things can cause the error you are experiencing, and it can be hard to pinpoint the exact cause.

I would advise you to make sure that you are using the latest versions of `react` and `react-dom` declared in package.json, or remove the `node_modules` mentioned and install them again. Otherwise, you can double-check if you do not have multiple package.json files and the one being installed is an older version than what you are supposed to be using.

If the issue persists after attempting the above, please open an issue on our [React SDKs repository](https://github.com/auth0/auth0-react/issues) since this error seems related to React.

Have a good one,  
Vlad

---

<div class="post-metadata">

**Author:** ![JamesSeabrook-MRM](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jamesseabrook-mrm/32/75814_2.png) [@JamesSeabrook-MRM](https://community.auth0.com/u/JamesSeabrook-MRM)\
**Post date:** [July 25, 2025, 6:29am UTC](https://community.auth0.com/t/react-javascript-errors-within-auth0-code-using-auth-lock/189470/4 "2025-07-25T06:29:09Z")

</div>

The project I am using this in does not use React. The project is a simple Vanilla JS application. Are you saying that I need to bundle React and React DOM into my code in order to enable auth-lock?

---

<div class="post-metadata">

**Author:** ![vlad.murarasu](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vlad.murarasu/32/72793_2.png) [@vlad.murarasu](https://community.auth0.com/u/vlad.murarasu)\
**Post date:** [August 7, 2025, 11:58am UTC](https://community.auth0.com/t/react-javascript-errors-within-auth0-code-using-auth-lock/189470/5 "2025-08-07T11:58:05Z")

</div>

Hi @JamesSeabrook-MRM,

Apologies for the very late reply.

Even if your project doesn’t use React, [Auth0 Lock version 12 and newer are built internally using React](https://www.npmjs.com/package/auth0-lock?activeTab=dependencies). The error you are seeing comes from Lock’s own internal code. The most common cause for this is that Lock’s required `react` and `react-dom` libraries (which it needs to run) are not explicitly declared in your project’s `package.json`.

The recommended solution is to explicitly add `react` and `react-dom` to your project’s `package.json`. This ensures that your package manager (NPM) installs a single, correct version of these libraries that Lock can use.

If you have any further questions, feel free to reach out.

Have a good one,  
Vlad

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [August 21, 2025, 11:59am UTC](https://community.auth0.com/t/react-javascript-errors-within-auth0-code-using-auth-lock/189470/6 "2025-08-21T11:59:04Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
