OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
670 stars 96 forks source link

Excel Custom Functions stuck on #BUSY for IE 11 #2374

Closed Jason-Chieh-Lee closed 5 months ago

Jason-Chieh-Lee commented 2 years ago

Message from office-js bot: We’re closing this issue because it has been inactive for a long time. We’re doing this to keep the issues list manageable and useful for everyone. If this issue is still relevant for you, please create a new issue. Thank you for your understanding and continued feedback.

I'm trying to create an Office Addin with Custom Functions. I've generated the addin+custom functions using Yeoman generator and choosing to use Typescript. I can confirm that the custom functions work with Excel versions that run Chromium based browsers. However the functions do not work on Excel versions that run Internet Explorer 11, they are permanently stuck in a #BUSY state.

For Excels with IE 11, the taskpane loads/is rendered correctly, it's just the custom functions that don't work. I am testing the custom functions by using the default provided ones like ADD and LOG, which both get stuck in #BUSY for IE 11. Note that the function names do show up (if I start typing, =CONTOSO.ADD( does autocomplete. It's when I try and run it that it gets stuck. Any help is appreciated, thank you!

My Environment

Expected behavior

I expected custom functions to work correctly for Excel even if the browser uses IE 11.

Current behavior

Taskpane loads correctly, but all custom functions get stuck in #BUSY for Excel browsers that use IE 11.

Steps to reproduce

  1. Followed steps in the microsoft tutorials on how to make custom functions. Only difference here is I chose TypeScript as the script type.
  2. Build/host it on a static website on Azure.
  3. Used M365 admin center to deploy to a user with an Excel version that's still running IE 11.
  4. When the user types =CONTOSO.ADD(1,2) or any function, it gets stuck in #BUSY.

Provide additional details

I read in the docs that we might have to use Babel to support IE 11. I can post my package.json and webpack.config.js configurations that uses Babel. Please let me know if I'm doing anything wrong.

My webpack.config.js has the following:

module: {
  rules: [
    {
      test: /\.ts$/,
      exclude: /node_modules/,
      use: {
        loader: "babel-loader",
        options: {
          presets: ["@babel/preset-typescript", "@babel/preset-env"],
        },
      },
    },

My package.json has the following:

    "dependencies": {
    "core-js": "^3.9.1",
    "regenerator-runtime": "^0.13.7"
  },
  "devDependencies": {
    "@babel/core": "^7.13.16",
    "@babel/preset-env": "^7.16.8",
    "@babel/preset-typescript": "^7.13.0",

and at the bottom of the package.json, I also have this:

      "browserslist": [
    "IE 11"
  ]

My babel.config.json looks like this:

{
  "presets": ["@babel/preset-typescript", "@babel/preset-env"]
}

Context

Trying to build an Excel Office Addin with custom functions that is able to run on as many versions of Excel as possible.

Jason-Chieh-Lee commented 2 years ago

Hi guys,

Has there been any updates on this issue?

JHJ-MS commented 2 years ago

Hi @Jason-Chieh-Lee, I can not repro it. I have generated a Custom Functions Add-in project using yo office and choosing TypeScript. I run this project on Excel Desktop that is using IE11. The basic custom function =CONTOSO.ADD(1,2) is working as expected.

May I know how you config your Excel to use IE11 but not Chromium-based browsers?

Jason-Chieh-Lee commented 2 years ago

I followed the instructions here in Microsoft's tutorial https://docs.microsoft.com/en-us/office/dev/add-ins/testing/ie-11-testing#install-a-version-of-office-that-uses-internet-explorer

and installed a version that uses IE 11 for example 16.0.13127.21668. Was the version I provided above not running IE 11?

If that's the case, then the version I ran above also does not work.

Another one of my questions is are there supposed to be additional steps we had to take in order to run things on IE 11? Or should generating a Custom Function using yo generator supposed to be compatible with IE 11 right out the box?

Jason-Chieh-Lee commented 2 years ago

Furthermore, could it be an issue with configuring the addin to use a shared runtime?

adammpolak commented 1 year ago

@Jason-Chieh-Lee I am also using a shared runtime and making a custom function that does a webrequest never responds.