Lack of stack trace information when an error occurs in the Office JS API

We get many Office JS API errors in Application Insights, but they do not have a stack trace. All we have is The browser same-origin policy prevents us from getting the details of this exception. Consider using 'crossorigin' attribute.. Note: we set the crossorigin attribute to office.jsin the HTML add-in:

<script src="//appsforoffice.microsoft.com/lib/1.1/hosted/office.js" type="text/javascript" crossorigin="anonymous"></script>

The problem is this: office.js inserts additional scripts depending on the environment, and these scripts do not have a set for matching. For example, https://appsforoffice.microsoft.com/lib/1.1/hosted/outlook-win32-16.01.jsor the one that you enter in Outlook for Mac. It is very painful not to have access to the stack trace and not be able to report these errors in Stackoverflow :)

+4
source share

Source: https://habr.com/ru/post/1685930/


All Articles