Search code examples
office365office-addinsoffice-app

In Office Apps - Cannot redefine non-configurable property 'context'"


This is similar to In Office Apps for Excel 2013 - Cannot redefine non-configurable property 'context'".

However it only happens on IE 11 and Edge. My use case is followin: I open outlook or any office application add-in. I run a pop-up for OAuth, on popup close i redirect the iframe to another page.

First time i open the addin and finish OAuth flow everything is working correctly. However when I close the add-in and open it again (this time redirect is done automatically because user is authentication and is recognized by cookie) Office Add-in fails to start, when i restart it manually few times it will open up and work correctly.

Error I'm getting is: Cannot redefine non-configurable property 'context' in Office.js (o15apptofilemappingtable.js (11,3563))

Edit: Issue also occurs on Firefox and Chrome, however it is handled more gracefully and add-in doesn't crash, it starts with error logged to the console.


Solution

  • In the end issue was that there were two Office.js libraries of different version referenced. When older one was removed, issue was gone.