If you want to use Vite to build the React Okta App, you maybe face some incompatible issues. I will share some of my research in this post.
Issue 1: Uncaught TypeError: Class extends value undefined is not a constructor or null #
As the Okta's staff said, It's a known issue with the ESM bundle of okta-auth-js.
So, we should add the below into the
Issue2: Security.tsx:99 Uncaught ReferenceError: process is not defined #
Solution: Add the below code to the
You can find the final version code on okta-demo.
- Server version is used in browser when bundled with Vite
- Uncaught ReferenceError: process is not defined
Since you've made it this far, sharing this article on your favorite social media network would be highly appreciated 💖! For feedback, please ping me on Twitter.