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.js
in 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.js
or 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 :)
source
share