the javascript-basic-consumer example makes use of msal via the CDN link: https://alcdn.msauth.net/browser/2.19.0/js/msal-browser.min.js
however, if you use an up-to-date version of msal it no longer works.
the solution is to call the initialize() method like this:
const msalInstance = new PublicClientApplication(msalConfig);
await msalInstance.initialize();
https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/v2-migration.md#option-1
i think there might be more issues with compatibility with the newer msal, but i figured this was a good place to start.
with thanks