index.html
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script type="text/javascript" src="https://alcdn.msauth.net/browser/2.35.0/js/msal-browser.min.js" defer></script>
<script src="./pages/index/index.js" defer type="module"></script>
<title>Homepage</title>
</head>
./pages/index/index.js
const myMSALObj = new msal.PublicClientApplication(msalConfig);
I’m using @msal/browser via CDN. Can anyone explain why msal is not defined and how to solve it?
More than 3 hours now … i still don’t know what’s going on
New contributor
54935 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
The problem may come from the defer, can you remove the tags and put the following in your index.js ?
Can you add:
document.addEventListener("DOMContentLoaded", function() {
const myMSALObj = new msal.PublicClientApplication(msalConfig);
});
Thanks !