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

Uncaught TypeError: l.current is null when using react-dom 18.3.1 #759

Open
6 tasks done
tnguyen14 opened this issue Apr 28, 2024 · 2 comments
Open
6 tasks done

Uncaught TypeError: l.current is null when using react-dom 18.3.1 #759

tnguyen14 opened this issue Apr 28, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@tnguyen14
Copy link

Checklist

Description

React recently released a new version, 18.3.1. In this version of react-dom, using the Auth0Provider throws an error

Uncaught TypeError: l.current is null

Please note that the version of react doesn't matter, i.e. can use either 18.2.0 or 18.3.1. This error happens only with version 18.3.1 of react-dom.

Reproduction

import React from 'https://esm.sh/[email protected]';
import { render } from 'https://esm.sh/[email protected]';
import { Auth0Provider } from 'https://esm.sh/@auth0/auth0-react@2';

render(
    <Auth0Provider
      domain="auth0.com"
      clientId="<client-id>"
      cacheLocation="localstorage"
      useRefreshTokens={true}
      useRefreshTokensFallback={true}
      authorizationParams={{
        redirect_uri: window.location.href,
        audience: "<api-audience>",
        scope: "openid profile email"
      }}
    >
        <div>Hello World</div>
    </Auth0Provider>,
    document.querySelector(".main")
);

Additional context

No response

auth0-react version

2.2.4

React version

18.3.1

Which browsers have you tested in?

Chrome, Edge, Firefox

@tnguyen14 tnguyen14 added the bug Something isn't working label Apr 28, 2024
tnguyen14 added a commit to tnguyen14/ledge that referenced this issue Apr 28, 2024
@ije
Copy link

ije commented May 1, 2024

you may need to add [email protected] to https://esm.sh/@auth0/auth0-react@2

import { Auth0Provider } from 'https://esm.sh/@auth0/auth0-react@[email protected]';

@tnguyen14
Copy link
Author

@ije thanks for the suggestion. I tried specifying the deps query parameter, for both versions 18.2.0 and 18.3.1. It doesn't solve the problem, unless the versions of react and react-dom themselves (in the module, not as the query parameter) are pinned to 18.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants