'okta-auth-js Uncaught TypeError: Super expression must either be null or a function

After making the production build I am getting this error in the console and the application is not getting loaded.

enter image description here

My Environment:

OS: Linux/Ubuntu
React version: 16.13.0
@okta/okta-auth-js: 5.2.2
@okta/okta-react: 6.0.0
@okta/okta-signin-widget: 5.5.0


Solution 1:[1]

So basically I used okta's CDN and initialize it in the index.html and it worked.

Put this in your index.html head tag.

<script
  src="https://global.oktacdnenter code here.com/okta-auth-js/4.5.0/okta-auth-js.min.js"
  type="text/javascript"
></script>
<script>
  var redirectUri = `${location.origin}/okta`;
    window.myOkta = new OktaAuth({
     ...your credentials goes here.
    })
</script>

now you can used myOkta variable as okta Api.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1