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

Sideload fails: "ADD-IN ERROR: This add-in is no longer available." #1414

Closed chucklay closed 6 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.

Not sure if this is a bug with office-js or excel itself, but my Excel installation seems to be stuck, not letting me sideload my add-in. Attempting to npm run start an add-in causes this error message in the task pane: image

Expected Behavior

npm run start should sideload an add-in, unless there are other problems preventing this from happening. If something is preventing this add-in from loading, the error message should provide better feedback.

Current Behavior

npm run start successfully launches the debug server, which builds the add-in successfully, and launches excel. However, even before the debug server finishes building the add-in, excel displays the message in the screenshot above. I'm able to sideload this add-in to Excel online without issue (in both edge and ie11).

Steps to Reproduce, or Live Example

This is my manifest (which passes validation): https://gist.github.com/chucklay/5276628e8f08f6d10c2b99762fcdd649 There were no changes to this manifest (or the add-in in general) between when sideloading this add-in worked and now.

Context

Your Environment

Useful logs

I cannot find any logs that suggest where the issue might be. I'm open to suggestions.

chucklay commented 3 years ago

Sorry to beg for help again, but this is a complete blocker, and nothing I've turned up has helped. I've tried loading this on another computer, with the same result. Even rolling back to a previous version of the manifest (And add-in in general) that I know worked hasn't helped.

chucklay commented 3 years ago

Aaand as soon as I leave that comment, I found the issue. While the add-in's HighResoutionIcon has to be 64x64, if the high resolution icon for your buttons is anything other than 80x80, you get this error. I'd like to change this issue to a request to have the manifest validator catch that, since your add-in will not work if you don't have it right.

TCourtneyOwen commented 3 years ago

Sorry to hear you are having problems. A few questions for you:

-Courtney

TCourtneyOwen commented 3 years ago

So in reading through this thread is the real issue the size of the icon?

chucklay commented 3 years ago

Yes, the icon size of my taskpane buttons was the problem. I had them set to 64x64. (I had done a find/replace to switch 80x80->64x64 after my HighResolutionIcon was incorrectly set to 80x80). However, it appears that Excel cached the old button icon, so this issue didn't pop up until much later.

What was really confusing is that this doesn't prevent the add-in from sideloading into excel online. That combined with manifest validation not catching this made the problem really hard to track down.

TCourtneyOwen commented 3 years ago

So essentially manifest validation fails when the icon size is set to 64x64? If this is the case I can see about asking that we don't fail manifest validation for this, but this will not be a quick fix, as I believe this is owned by our team in Ireland.

-Courtney

chucklay commented 3 years ago

Actually it's the opposite problem - If the icons are the wrong size, npm run validate claims that the manifest IS valid, and the add-in will load in Excel online. However, using npm run start to run on desktop will cause it to not load with the error message/description in my original post.

TCourtneyOwen commented 3 years ago

Interestingly, I changed my manifest to use 64x64 icons and was able to start my add-in project successfully in Desktop. I am using a Excel taskpane project I created via Yo Office

chucklay commented 3 years ago

Hmm, strange. Just to clarify, the incorrectly sized icons were for my ribbon buttons. Maybe it had something to do with them being on a custom tab? This is the problem section in question, and this version of my manifest does demonstrate the problem: https://gist.github.com/chucklay/4f8d1da6a5b15234b194552a2a1f0211#file-manifest-xml-L61-L105

Based on the feedback I got when I submitted this add-in (I hadn't hit this problem yet, I assume due to caching), I think the testers ran into this problem too.

awasser-omnispear commented 3 years ago

I'd like to pile on my experience as well. I am encountering the same issue, but with the Yo Office result directly without any change to the manifest or any of the code.

I've tried a number of templates in yo office, and even cloning the Custom Functions template directly from github. All have the same yellow dialog as OP's screenshot.

danlg commented 2 years ago

@chucklay thanks for your post. I am facing the same issue but using in manifest.xml a HighResolutionIcon to 80x80 didn't solve it. I am on Mac BigSur OS. Actually the error is slightly different. I have tried to clear the cache because I wanted to change the default icon but now it cannot reload an addin. image image