There was unexpected error

This is my first time using Okta.

I run into there error while trying to sign i.

“There was an unexpected error. Please try again”

I have pasted the entire simple code, please help check it out.

<!doctype html>

Simple Web Page h1 { margin: 2em 0; }
var oktaSignIn = new OktaSignIn({ baseUrl: "https://dev-19149832.okta.com", clientId: "0oabq125xE8mW0MyD5d6", authParams: { issuer: "https://dev-19149832.okta.com/oauth2/default", responseType: ['token', 'id_token'], display: 'page' } });
  if (oktaSignIn.token.hasTokensInUrl()) {
    oktaSignIn.token.parseTokensFromUrl(
      // If we get here, the user just logged in.
      function success(res) {
        var accessToken = res[0];
        var idToken = res[1];

        oktaSignIn.tokenManager.add('accessToken', accessToken);
        oktaSignIn.tokenManager.add('idToken', idToken);

        window.location.hash='';
        document.getElementById("messageBox").innerHTML = "Hello, " + idToken.claims.email + "! You just logged in! :)";
      },
      function error(err) {
        console.error(err);
      }
    );
  } else {
    oktaSignIn.session.get(function (res) {
      // If we get here, the user is already signed in.
      if (res.status === 'ACTIVE') {
        document.getElementById("messageBox").innerHTML = "Hello, " + res.login + "! You are *still* logged in! :)";
        return;
      }
      oktaSignIn.renderEl(
        { el: '#okta-login-container' },
        function success(res) {},
        function error(err) {
          console.error(err);
        }
      );
    });
  }
</script>

Hi @Manymen,

Do you see any failures in the network tab of the browser tools when this issue occurs ? Anything in the console ?

You could probably try using showSignInToGetTokens or showSignAndRedirect instead of renderEl as mentioned in this doc.

If you need help in troubleshooting, please create a case with Okta Support or email developers@okta.com with logs and all the other details like sdk versions used etc.