We spent a good amount of time on a similar problem. Here are my thoughts, if you are not using the form elements or (Form from CRM) you may completely avoid using formContext. This doesn't mean you can't access XRM. You may access XRM by below simple code. It took almost 6 hours for me to find just a line of code.
userInfo = window.parent.Xrm.Utility.getGlobalContext().userSettings;
If you want to still use formContext (assuming you use the form from CRM) you can follow the below-mentioned steps. Remember, you may need to register an event in Dynamics 365 in order to call it on form load.
How to Use FormContext in a Web Resource in Dynamics 365 Power Apps with getContentWindow - Carl de Souza[
^]
Thanks
Rushi