-->

No stack trace info when error happens in Office J

2019-02-14 01:58发布

问题:

We're getting lots of Office JS API errors in Application Insights, but they don't have a stack trace. All that we have - The browser's same-origin policy prevents us from getting the details of this exception. Consider using 'crossorigin' attribute.. Note, we have set 'crossorigin' attribute to office.js in Add-In HTML:

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

The issue is following: office.js injects additional scripts depending on environment and these scripts don't have crossorigin set. For example https://appsforoffice.microsoft.com/lib/1.1/hosted/outlook-win32-16.01.js or the one which is injected in Outlook for Mac. It's really painful not to have access to stack trace and not be able to report these errors to Stackoverflow :)