Cannot read properties of undefined (reading 'Auth0Client')

The error message “Cannot read properties of undefined (reading ‘Auth0Client’)” typically occurs when you’re trying to access a property or method of an object that hasn’t been initialized yet. In this case, it seems like auth0Web might be undefined when you’re trying to call onLoad() on it.

Here are a few things you could check:

Ensure that auth0Web is properly initialized before this code runs. It should be an instance of Auth0Client .

Check if the Auth0 library is correctly imported and available in the scope where you’re trying to use it.

If the Auth0 library is being loaded asynchronously, there might be a timing issue where your code is running before the library has fully loaded. You might need to add some checks or use a callback to ensure the library is loaded before running your code.

There might be an issue with the configuration of the Auth0 client. Make sure all the necessary parameters (like domain and client ID) are correctly set.