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
681 stars 95 forks source link

Taskpane addins stuck on loading screen, sometimes eventually open. Desktop only. #1579

Closed chucklay closed 7 months ago

chucklay commented 3 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.

This is a weird one. I'm attempting to switch my Excel add-in back to individual runtimes instead of a shared runtime. (on a related note - is there any timeframe on when we can expect add-ins that use shared runtimes to use edge-based web views instead of IE-based?) I have everything working on excel on the web, but when I try to open the taskpane on desktop Excel, it sticks for about a minute on the loading spinner, then eventually shows the "Add-in error: This add-in could not be started" banner, but as soon as that banner pops up, my add-in loads: image

It seems to run fine once it loads, and I don't see any errors or problems in the browser console or any logs that I can find, so I have no idea where the issue is.

Expected Behavior

My add-in should load without displaying an error message.

Current Behavior

My add-in eventually loads, but displays an error message in the proccess

Steps to Reproduce, or Live Example

I assume the issue is probably related to my manifest, so this is what it looks like:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp">
  <Id>16d0e6ab-4073-48e9-932c-e6c73ae6b37a</Id>
  <Version>1.0.0.1</Version>
  <ProviderName>Tartan Solutions, Inc</ProviderName>
  <DefaultLocale>en-US</DefaultLocale>
  <DisplayName DefaultValue="PlaidCloud"/>
  <Description DefaultValue="A template to get started."/>
  <IconUrl DefaultValue="https://localhost:3000/assets/Cloud-Icon_32x32.png"/>
  <HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/Cloud-Icon_80x80.png"/>
  <SupportUrl DefaultValue="https://www.plaidcloud.com/resources"/>
  <AppDomains>
    <AppDomain>plaidcloud.net</AppDomain>
    <AppDomain>plaidcloud.net</AppDomain>
    <AppDomain>plaidcloud.com</AppDomain>
    <AppDomain>plaidcloud.io</AppDomain>
  </AppDomains>
  <Hosts>
    <Host Name="Workbook"/>
  </Hosts>
  <Requirements>
    <Sets DefaultMinVersion="1.1">
      <Set Name="CustomFunctionsRuntime" MinVersion="1.1"/>
      <Set Name="ExcelApi" MinVersion="1.9"/>
    </Sets>
  </Requirements>
  <DefaultSettings>
    <SourceLocation DefaultValue="https://localhost:3000/taskpane.html?plaid_url=plaidcloud.net"/>
  </DefaultSettings>
  <Permissions>ReadWriteDocument</Permissions>
  <VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Hosts>
      <Host xsi:type="Workbook">
        <AllFormFactors>
          <ExtensionPoint xsi:type="CustomFunctions">
            <Script>
              <SourceLocation resid="Functions.Script.Url"/>
            </Script>
            <Page>
              <SourceLocation resid="Functions.Page.Url"/>
            </Page>
            <Metadata>
              <SourceLocation resid="Functions.Metadata.Url"/>
            </Metadata>
            <Namespace resid="Functions.Namespace"/>
          </ExtensionPoint>
        </AllFormFactors>
        <DesktopFormFactor>
          <GetStarted>
            <Title resid="GetStarted.Title"/>
            <Description resid="GetStarted.Description"/>
            <LearnMoreUrl resid="GetStarted.LearnMoreUrl"/>
          </GetStarted>
          <FunctionFile resid="Commands.Url"/>
          <ExtensionPoint xsi:type="PrimaryCommandSurface">
            <CustomTab id="PlaidCloud.AddinTab">
              <Group id="CommandsGroup">
                <Label resid="CommandsGroup.Label"/>
                <Icon>
                  <bt:Image size="16" resid="Icon.16x16"/>
                  <bt:Image size="32" resid="Icon.32x32"/>
                  <bt:Image size="80" resid="Icon.80x80"/>
                </Icon>
                <Control xsi:type="Button" id="TaskpaneButton">
                  <Label resid="TaskpaneButton.Label"/>
                  <Supertip>
                    <Title resid="TaskpaneButton.Label"/>
                    <Description resid="TaskpaneButton.Tooltip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.16x16"/>
                    <bt:Image size="32" resid="Icon.32x32"/>
                    <bt:Image size="80" resid="Icon.80x80"/>
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <TaskpaneId>ButtonId1</TaskpaneId>
                    <SourceLocation resid="Taskpane.Url"/>
                  </Action>
                </Control>
                <Control xsi:type="Button" id="PullAllButton">
                  <Label resid="PullAllButton.Label"/>
                  <Supertip>
                    <Title resid="PullAllButton.Label"/>
                    <Description resid="PullAllButton.Tooltip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.16x16"/>
                    <bt:Image size="32" resid="Icon.32x32"/>
                    <bt:Image size="80" resid="Icon.80x80"/>
                  </Icon>
                  <Action xsi:type="ExecuteFunction">
                    <FunctionName>syncAll</FunctionName>
                  </Action>
                </Control>
                <Control xsi:type="Button" id="PullOneButton">
                  <Label resid="PullOneButton.Label"/>
                  <Supertip>
                    <Title resid="PullOneButton.Label"/>
                    <Description resid="PullOneButton.Tooltip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.16x16"/>
                    <bt:Image size="32" resid="Icon.32x32"/>
                    <bt:Image size="80" resid="Icon.80x80"/>
                  </Icon>
                  <Action xsi:type="ExecuteFunction">
                    <FunctionName>syncOne</FunctionName>
                  </Action>
                </Control>
              </Group>
              <Label resid="PlaidTab.Label"/>
            </CustomTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>
    <Resources>
      <bt:Images>
        <bt:Image id="Icon.16x16" DefaultValue="https://localhost:3000/assets/Cloud-Icon_16x16.png"/>
        <bt:Image id="Icon.32x32" DefaultValue="https://localhost:3000/assets/Cloud-Icon_32x32.png"/>
        <bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/Cloud-Icon_80x80.png"/>
      </bt:Images>
      <bt:Urls>
        <bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3000/functions.js?plaid_url=plaidcloud.net"/>
        <bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3000/dist/functions.json"/>
        <bt:Url id="Functions.Page.Url" DefaultValue="https://localhost:3000/functions.html?plaid_url=plaidcloud.net"/>
        <bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812"/>
        <bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html?plaid_url=plaidcloud.net"/>
        <bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html?plaid_url=plaidcloud.net"/>
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="Functions.Namespace" DefaultValue="PLAID"/>
        <bt:String id="GetStarted.Title" DefaultValue="Get started with PlaidCloud!"/>
        <bt:String id="CommandsGroup.Label" DefaultValue="PlaidCloud Operations"/>
        <bt:String id="TaskpaneButton.Label" DefaultValue="PlaidCloud Connect"/>
        <bt:String id="PullAllButton.Label" DefaultValue="Pull All"/>
        <bt:String id="PullOneButton.Label" DefaultValue="Pull Current Worksheet"/>
        <bt:String id="PlaidTab.Label" DefaultValue="PlaidCloud"/>
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="GetStarted.Description" DefaultValue="The PlaidCloud add-in loaded succesfully. Go to the PlaidCloud tab and click the 'PlaidCloud Connect' button to get started."/>
        <bt:String id="TaskpaneButton.Tooltip" DefaultValue="Click to Show the PlaidCloud Taskpane"/>
        <bt:String id="PullAllButton.Tooltip" DefaultValue="Pull all tables connnected to PlaidCloud"/>
        <bt:String id="PullOneButton.Tooltip" DefaultValue="Pull active worksheet from PlaidCloud"/>
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
</OfficeApp>

Context

This is preventing me from switching back to individual runtimes.

Your Environment

Useful logs

image

npm run validate

> office-addin-taskpane-react@0.0.1 validate C:\Users\Charlie\src\PlaidXL
> office-addin-manifest validate manifest.xml

The manifest is not valid.

Error # 1: 
High Resolution Icon URL Unreachable: Unable to retrieve an image from the high resolution icon URL.
  - Details: The HighResolutionIconURL supplied in the app manifest is not reachable, HighResolutionIconURL : https://localhost:3000/assets/Cloud-Icon_80x80.png.

Error # 2: 
Icon URL Unreachable: Unable to retrieve an image from the icon URL.
  - Details: The IconURL supplied in the app manifest is not reachable, IconURL : https://localhost:3000/assets/Cloud-Icon_32x32.png.

Additional information: 
Package Type Identified: Package of your add-in was parsed successfully.

Correct Package: Your package matches the submission type.

Valid Manifest Schema: Your manifest does adhere to the current set of XML schema definitions for Add-in manifests.

Manifest Version Correct Structure: The manifest version number has the correct structure for the platform that it supports.

Manifest Version Correct Value: The manifest version number is greater or equal to 1.0.

Manifest ID Valid Prefix: The product ID in the manifest has a valid prefix
  - Details: 16d0e6ab-4073-48e9-932c-e6c73ae6b37a

Manifest ID Correct Structure: The structure of the product ID is correct.
  - Details: 16d0e6ab-4073-48e9-932c-e6c73ae6b37a

Desktop Source Location Present: A desktop or default source location URL is found.

Secure Desktop Source Location: The manifest desktop source location URLs use HTTPS.

Supported Office Identified: Supported Office products were successfully determined.

Support URL Present: The manifest support URL is present.
  - Details: https://www.plaidcloud.com/resources

Valid Support URL: The manifest support URL is valid.

High Resolution Icon Present: A high resolution icon element was expected and is present.
  - Details: https://localhost:3000/assets/Cloud-Icon_80x80.png

Supported High Resolution Icon URL File Extension: The manifest high resolution icon URL has a valid image file extension.
  - Details: png

Secure High Resolution Icon URL: The manifest high resolution icon URL uses HTTPS.
  - Details: https://localhost:3000/assets/Cloud-Icon_80x80.png

Icon Present: A icon element was expected and is present.
  - Details: https://localhost:3000/assets/Cloud-Icon_32x32.png

Supported Icon URL File Extension: The manifest icon URL has a valid image file extension.
  - Details: png

The manifest icon URL uses HTTPS.: Secure Icon URL
  - Details: https://localhost:3000/assets/Cloud-Icon_32x32.png

Acceptance Test Completed: Acceptance test service has finished checking provided add-in.

OfficeAddins.log.txt:

1/7/2021 11:15:35   Medium  Web Add-In Runtime Logging Session Started          
1/7/2021 11:15:35   Verbose CustomFunctions [Metadata] [Parsing] [Begin]        
1/7/2021 11:15:35   Verbose CustomFunctions [Metadata] [Parsing] [Begin] Function       
1/7/2021 11:15:35   Medium  CustomFunctions [Metadata] [Parsing] [End] [Success] Function=PLAID.DISTINCT        
1/7/2021 11:15:35   Verbose CustomFunctions [Metadata] [Parsing] [Begin] Function       
1/7/2021 11:15:35   Medium  CustomFunctions [Metadata] [Parsing] [End] [Success] Function=PLAID.TAB     
1/7/2021 11:15:35   Medium  CustomFunctions [Metadata] [Parsing] [End] [Success]        
1/7/2021 11:15:35   Verbose CustomFunctions [Installation] [Functions] [Begin] Solution=16d0e6ab-4073-48e9-932c-e6c73ae6b37a, Workbook=Excel add-in 16d0e6ab-4073-48e9-932c-e6c73ae6b37a.xlsx       
1/7/2021 11:15:35   Verbose CustomFunctions [Registration] [Begin] Function=PLAID.DISTINCT, Workbook=Excel add-in 16d0e6ab-4073-48e9-932c-e6c73ae6b37a.xlsx     
1/7/2021 11:15:35   Medium  CustomFunctions [Registration] [End] [Success] Function=PLAID.DISTINCT, Workbook=Excel add-in 16d0e6ab-4073-48e9-932c-e6c73ae6b37a.xlsx     
1/7/2021 11:15:35   Verbose CustomFunctions [Registration] [Begin] Function=PLAID.TAB, Workbook=Excel add-in 16d0e6ab-4073-48e9-932c-e6c73ae6b37a.xlsx      
1/7/2021 11:15:35   Medium  CustomFunctions [Registration] [End] [Success] Function=PLAID.TAB, Workbook=Excel add-in 16d0e6ab-4073-48e9-932c-e6c73ae6b37a.xlsx      
1/7/2021 11:15:35   Medium  CustomFunctions [Installation] [Functions] [End] [Success] Solution=16d0e6ab-4073-48e9-932c-e6c73ae6b37a, Workbook=Excel add-in 16d0e6ab-4073-48e9-932c-e6c73ae6b37a.xlsx       
1/7/2021 11:15:35   Verbose CustomFunctions [Metadata] [Parsing] [Begin]        
1/7/2021 11:15:35   Medium  CustomFunctions [Metadata] [Parsing] [End] [Success]        
1/7/2021 11:15:35   Verbose CustomFunctions [Installation] [Functions] [Begin] Solution=wa104380862, Workbook=Excel add-in 16d0e6ab-4073-48e9-932c-e6c73ae6b37a.xlsx        
1/7/2021 11:15:35   Medium  CustomFunctions [Installation] [Functions] [End] [Success] Solution=wa104380862, Workbook=Excel add-in 16d0e6ab-4073-48e9-932c-e6c73ae6b37a.xlsx        
1/7/2021 11:15:35   Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 316f38d0-7875-46b4-ba68-2ef518523f59, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Runtimes", Line=36, CharPosition=10       
1/7/2021 11:15:35   Monitorable Manifest    Skipped unrecognized XML element for add-in ID : 316f38d0-7875-46b4-ba68-2ef518523f59, Location : Element Namespace "http://schemas.microsoft.com/office/taskpaneappversionoverrides" : Element Name "Runtimes", Line=36, CharPosition=10       
1/7/2021 11:15:37   Verbose CustomFunctions [Metadata] [Parsing] [Begin]        
1/7/2021 11:15:37   Verbose CustomFunctions [Metadata] [Parsing] [Begin] Function       
1/7/2021 11:15:37   Medium  CustomFunctions [Metadata] [Parsing] [End] [Success] Function=PLAID.DISTINCT        
1/7/2021 11:15:37   Verbose CustomFunctions [Metadata] [Parsing] [Begin] Function       
1/7/2021 11:15:37   Medium  CustomFunctions [Metadata] [Parsing] [End] [Success] Function=PLAID.TAB     
1/7/2021 11:15:37   Medium  CustomFunctions [Metadata] [Parsing] [End] [Success]        
1/7/2021 11:15:37   Verbose CustomFunctions [Installation] [Addin] [Begin] Solution=16d0e6ab-4073-48e9-932c-e6c73ae6b37a, Version=1.0.0.1       
1/7/2021 11:15:37   Medium  CustomFunctions [Installation] [Addin] [End] [Success] Solution=16d0e6ab-4073-48e9-932c-e6c73ae6b37a, Version=1.0.0.1       
1/7/2021 11:15:37   Verbose CustomFunctions [Installation] [Functions] [Begin] Solution=16d0e6ab-4073-48e9-932c-e6c73ae6b37a, Workbook=Excel add-in 16d0e6ab-4073-48e9-932c-e6c73ae6b37a.xlsx       
1/7/2021 11:15:37   Verbose CustomFunctions [Registration] [Begin] Function=PLAID.DISTINCT, Workbook=Excel add-in 16d0e6ab-4073-48e9-932c-e6c73ae6b37a.xlsx     
1/7/2021 11:15:37   Medium  CustomFunctions [Registration] [End] [Success] Function=PLAID.DISTINCT, Workbook=Excel add-in 16d0e6ab-4073-48e9-932c-e6c73ae6b37a.xlsx     
1/7/2021 11:15:37   Verbose CustomFunctions [Registration] [Begin] Function=PLAID.TAB, Workbook=Excel add-in 16d0e6ab-4073-48e9-932c-e6c73ae6b37a.xlsx      
1/7/2021 11:15:37   Medium  CustomFunctions [Registration] [End] [Success] Function=PLAID.TAB, Workbook=Excel add-in 16d0e6ab-4073-48e9-932c-e6c73ae6b37a.xlsx      
1/7/2021 11:15:37   Medium  CustomFunctions [Installation] [Functions] [End] [Success] Solution=16d0e6ab-4073-48e9-932c-e6c73ae6b37a, Workbook=Excel add-in 16d0e6ab-4073-48e9-932c-e6c73ae6b37a.xlsx       
1/7/2021 11:15:37   Verbose CustomFunctions [Metadata] [Parsing] [Begin]        
1/7/2021 11:15:37   Verbose CustomFunctions [Metadata] [Parsing] [Begin] Function       
1/7/2021 11:15:37   Medium  CustomFunctions [Metadata] [Parsing] [End] [Success] Function=PLAID.DISTINCT        
1/7/2021 11:15:37   Verbose CustomFunctions [Metadata] [Parsing] [Begin] Function       
1/7/2021 11:15:37   Medium  CustomFunctions [Metadata] [Parsing] [End] [Success] Function=PLAID.TAB     
1/7/2021 11:15:37   Medium  CustomFunctions [Metadata] [Parsing] [End] [Success]        
1/7/2021 11:16:38   Verbose CustomFunctions [Metadata] [Parsing] [Begin]        
1/7/2021 11:16:38   Verbose CustomFunctions [Metadata] [Parsing] [Begin] Function       
1/7/2021 11:16:38   Medium  CustomFunctions [Metadata] [Parsing] [End] [Success] Function=PLAID.DISTINCT        
1/7/2021 11:16:38   Verbose CustomFunctions [Metadata] [Parsing] [Begin] Function       
1/7/2021 11:16:38   Medium  CustomFunctions [Metadata] [Parsing] [End] [Success] Function=PLAID.TAB     
1/7/2021 11:16:38   Medium  CustomFunctions [Metadata] [Parsing] [End] [Success]        

Interesting to note that I don't have a Runtimes section anymore, so I'm not sure why that's showing up. The only other add-in I have installed is ScriptLab.

KelBowen commented 3 years ago

@jeremy-msft can you provide insight about the change from IE to Edge as the default browser for shared runtime? @lumine2008 can you provide further assistance on reverting to individual run times? @chucklay is the browser issue why you want to revert to the individual run times? Or is there another issue blocking you from using the shared runtime?

chucklay commented 3 years ago

@KelBowen Yes, we've found that debugging in edge-based web views is a much smoother experience. Plus, one of the things our add-in does is pull data from our database and stick it in spreadsheets. Some of these tables are pretty large, so when we send out a request to pull the data, the response ends up being pretty hefty. On modern browsers this isn't an issue as we're able to stream the responses and manage them in reasonably-sized chunks. However, there's no way to do this in IE, so it ends up trying to load the whole response at once, which is more than it can handle.

The add-in still works in IE11, with the caveat that Edge or another modern browser might be required if someone wants to load a large table, which is a compromise we're more than willing to accept, since none of our clients use IE11 (and being totally honest, if it were an option we would drop support for IE11 completely - ensuring compatibility has been way more trouble than it's worth)

chucklay commented 3 years ago

One thing I've noticed just now: the add-in sometimes loads with the error message after ~a minute, but sometimes the loading screen just hangs indefinitely. When it hangs indefinitely, the "We're starting the add-ins runtime, please wait a moment..." message is also stuck on the bottom of the screen.

chucklay commented 3 years ago

I've also noticed (and this is essentially speculation at this point) some behavior that almost seems like it's trying to open the add-in twice. Clicking the taskpane toggle again after waiting for my add-in to load (with the error message) it opens a second taskpane tab instead of hiding the existing taskpane. In addition, another dev who tried to load my changes had the "Using multiple taskpanes?" notice pop up. I'd suspect some kind of circular reference but I don't see anything in the logs or my code that would suggest that.

jeremy-msft commented 3 years ago

Hi @chucklay, Re: Edge support for shared runtime, please see @smaremanda's comment here about timelines. This should be rolling out soon.

chucklay commented 3 years ago

@jeremy-msft Fantastic! Thanks!

chucklay commented 3 years ago

I still really need some help getting my add-in to load. I've rolled back to a version that I know works (using a shared runtime), but I'm still getting a blank taskpane (now without a loading spinner). OfficeAddins.log.txt still doesn't provide any useful information, and again, this is only happening on desktop. It loads perfectly fine in every browser I try.

It seems like debugging/logging the add-in as it actually loads could use some major improvement. I feel like every time I modify my manifest in any way, there's a 50% chance I'm going to have to spend the rest of the day (or week in this case) feeling around in the dark trying to fix a problem I get no feedback on.

ozhanatali commented 3 years ago

I don't want to open a new issue on it but shared runtime absolutely not working with webview2 on the latest excel build (even with the latest beta 13707.200008)

System: Windos10 Webview: webview2 Env. : sharedruntime addin : excel symptom: taskpane not loading (https://github.com/MicrosoftEdge/WebView2Feedback/issues/820#issuecomment-760580110) same manifest.xml works well on office web,

jeremy-msft commented 3 years ago

Including @smaremanda for the reported WebView2 issue.

jipinshi commented 3 years ago

@smaremanda, can you help take a look at this issue?

ElizabethSamuel-MSFT commented 2 years ago

@jeremy-msft Any update on this? Please reassign if you're not the right person for this.

Thanks.