Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add-in Error: Something went wrong and we couldn't start this add-in.

I am using Create React App to build an add-in for Excel. The add-in works well in the Excel for macOS.

The Repo

However, when I try to load it in Excel Online. After uploading the manifest file and opening the add-in, it shows

Add-in Error: Something went wrong and we couldn't start this add-in. Please try again later or contact your system administrator.

enter image description here

The console shows

Error while parsing the 'sandbox' attribute: 'ms-allow-popups' is an invalid sandbox flag.

I am already using HTTPS in development by HTTPS=true npm start.

What else may cause this? Thanks

like image 381
Hongbo Miao Avatar asked Nov 08 '22 19:11

Hongbo Miao


1 Answers

It sounds like you're hitting a timeout error. Make sure you're always handling calling Office.initialize() before any other code.

For example, I would call registerServiceWorker() from within your init method. You have a lot of things going on in there and it is firing off at the same time as initialize at the moment.

Office.initialize = () => {

  registerServiceWorker();
  ReactDOM.render(<App />, document.getElementById('root'));

};
like image 154
Marc LaFleur Avatar answered Nov 15 '22 04:11

Marc LaFleur