How to fix Uncaught TypeError: window.crypto.randomUUID is not a function in react JS app using MSAL after deploying it in IIS

After deploying the React js application which uses Single sign on process using MSAL library, the following error occurs in IIS.

Uncaught TypeError: window.crypto.randomUUID is not a function
    at d.value (CryptoOps.ts:70:5)
    at e.value (EventHandler.ts:64:5)
    at A.value (StandardController.ts:1801:5)
    at o.value (PublicClientApplication.ts:167:5)
    at MsalProvider.tsx:88:37
    at ol (react-dom.production.min.js:244:332)
    at Cc (react-dom.production.min.js:286:111)
    at react-dom.production.min.js:282:391
    at _ (scheduler.production.min.js:13:203)
    at MessagePort.R (scheduler.production.min.js:14:128)

Read more here: Source link