Error in outlook addin dialog. TypeError: can't redefine non-configurable property "context"
Error in outlook addin dialog. TypeError: can't redefine non-configurable property "context"
我正在尝试在我的 outlook add-in 中创建一个 dialog。我在加载 office 脚本时从对话框的浏览器控制台收到此错误。该对话框包含一个简单的 html 页面,其中包含 jquery 和 header.
中的 office 脚本引用
TypeError: can't redefine non-configurable property "context" outlook-web-16.01.js:19:9756
ObjectOrReflectDefineProperty self-hosted:1762
defineProperty self-hosted:1813
defineNondefaultProperty https://appsforoffice.microsoft.com/lib/beta/hosted/outlook-web-16.01.js:19
defineEnumerableProperty https://appsforoffice.microsoft.com/lib/beta/hosted/outlook-web-16.01.js:19
<anonymous> https://appsforoffice.microsoft.com/lib/beta/hosted/outlook-web-16.01.js:19
这是对话框页面的源代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sustainable Meeting Activated Successfully</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://appsforoffice.microsoft.com/lib/beta/hosted/office.debug.js"></script>
<script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js"></script>
<link
rel="stylesheet"
href="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/css/fabric.min.css"
/>
<link
rel="stylesheet"
href="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/css/fabric.components.min.css"
/>
<script src="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/js/fabric.min.js"></script>
</head>
<body>
<script>
(function () {
console.info("Test Dialog");
Office.initialize = (reason) => {
$(document).ready(function () {
Office.context.ui.messageParent(true);
});
};
})();
</script>
</body>
</html>
我该如何解决这个问题?
包括单个版本的 Office js。
改变
<script src="https://appsforoffice.microsoft.com/lib/beta/hosted/office.debug.js"></script>
<script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js"></script>
到
<script src="https://appsforoffice.microsoft.com/lib/beta/hosted/office.debug.js"></script>
或
<script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js"></script>
我正在尝试在我的 outlook add-in 中创建一个 dialog。我在加载 office 脚本时从对话框的浏览器控制台收到此错误。该对话框包含一个简单的 html 页面,其中包含 jquery 和 header.
中的 office 脚本引用TypeError: can't redefine non-configurable property "context" outlook-web-16.01.js:19:9756
ObjectOrReflectDefineProperty self-hosted:1762
defineProperty self-hosted:1813
defineNondefaultProperty https://appsforoffice.microsoft.com/lib/beta/hosted/outlook-web-16.01.js:19
defineEnumerableProperty https://appsforoffice.microsoft.com/lib/beta/hosted/outlook-web-16.01.js:19
<anonymous> https://appsforoffice.microsoft.com/lib/beta/hosted/outlook-web-16.01.js:19
这是对话框页面的源代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Sustainable Meeting Activated Successfully</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://appsforoffice.microsoft.com/lib/beta/hosted/office.debug.js"></script>
<script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js"></script>
<link
rel="stylesheet"
href="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/css/fabric.min.css"
/>
<link
rel="stylesheet"
href="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/css/fabric.components.min.css"
/>
<script src="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/js/fabric.min.js"></script>
</head>
<body>
<script>
(function () {
console.info("Test Dialog");
Office.initialize = (reason) => {
$(document).ready(function () {
Office.context.ui.messageParent(true);
});
};
})();
</script>
</body>
</html>
我该如何解决这个问题?
包括单个版本的 Office js。
改变
<script src="https://appsforoffice.microsoft.com/lib/beta/hosted/office.debug.js"></script>
<script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js"></script>
到
<script src="https://appsforoffice.microsoft.com/lib/beta/hosted/office.debug.js"></script>
或
<script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js"></script>