Javascript 在office.onReady上运行office加载项失败

Javascript 在office.onReady上运行office加载项失败,javascript,node.js,office-js,office-addins,Javascript,Node.js,Office Js,Office Addins,我使用node.js在本地计算机上运行Excel加载项,一切正常 在服务器上发布外接程序时,不会执行以下代码: Office.onReady(info => { if (info.host === Office.HostType.Excel) { document.getElementById("sideload-msg").style.display = "none"; document.getElementById("

我使用node.js在本地计算机上运行Excel加载项,一切正常

在服务器上发布外接程序时,不会执行以下代码:

Office.onReady(info => {
  if (info.host === Office.HostType.Excel) {
    document.getElementById("sideload-msg").style.display = "none";
    document.getElementById("app-body").style.display = "flex";
    document.getElementById("run").onclick = run;
  }
});
似乎
Office.onReady
会一直等到JSAPI被调用,而这永远不会发生


这与服务器上的node.js安装有关,还是可能有什么问题?

谢谢您的提问。您是否可以帮助确认您是否符合中所述的以下例外情况

However, there are exceptions to this practice. For example, suppose you want to open your add-in in a browser (instead of sideload it in an Office application) in order to debug your UI with browser tools. Since Office.js won't load in the browser, onReady won't run and the $(document).ready won't run if it's called inside the Office onReady.