Cannot read properties of undefined (reading 'Auth0Client')

When calling the following, I get the error “Cannot read properties of undefined (reading ‘Auth0Client’)”. What causes this?

  auth0Web.onLoad().then((final credentials) => setState(() {
    _user = credentials?.user;
  }));