在Office Apps中-无法重新定义不可配置的属性"context" [英] In Office Apps - Cannot redefine non-configurable property 'context'"

查看:164
本文介绍了在Office Apps中-无法重新定义不可配置的属性"context"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这类似于在Office Apps for Excel 2013-无法重新定义不可配置的属性"context"" .

但是,它仅在IE 11和Edge上发生. 我的用例如下: 我打开Outlook或任何Office应用程序加载项.我为OAuth运行了一个弹出窗口,在弹出窗口关闭时,我将iframe重定向到了另一个页面.

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.

我第一次打开插件并完成OAuth流程时,一切工作正常.但是,当我关闭外接程序并再次打开它时(这次重定向是自动完成的,因为用户已通过身份验证并被cookie识别),Office外接程序无法启动,当我手动重新启动几次后它将打开并工作正确.

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.

我遇到的错误是:无法在以下位置重新定义不可配置的属性"context" Office.js(o15apptofilemappingtable.js(11,3563))

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

在Firefox和Chrome上也会出现此问题,但是可以更合理地处理它,并且加载项不会崩溃,它会从记录到控制台的错误开始.

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.

推荐答案

最后,问题是引用了两个不同版本的Office.js库.当较旧的一个被删除时,问题就消失了.

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

这篇关于在Office Apps中-无法重新定义不可配置的属性"context"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆