No stack trace info when error happens in Office JS API

纵饮孤独 提交于 2019-11-30 05:12:35

问题


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 :)

来源:https://stackoverflow.com/questions/46294347/no-stack-trace-info-when-error-happens-in-office-js-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!