Uncaught TypeError: l.current is null when using react-dom 18.3.1
tnguyen14 opened this issue · 2 comments
tnguyen14 commented
Checklist
- The issue can be reproduced in the auth0-react sample app (or N/A).
- I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
- I have looked into the API documentation and have not found a suitable solution or answer.
- I have searched the issues and have not found a suitable solution or answer.
- I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- I agree to the terms within the Auth0 Code of Conduct.
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/react@18.3.1';
import { render } from 'https://esm.sh/react-dom@18.3.1';
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
ije commented
you may need to add ?deps=react@18.3.1
to https://esm.sh/@auth0/auth0-react@2
import { Auth0Provider } from 'https://esm.sh/@auth0/auth0-react@2?deps=react@18.3.1';