While working on MS Office JS add-ins I faced few issues.
In this blog posts am maintaining the list of issues which I have encounters and along with their resolutions.
Issue 1 : office-addin-debugging : command not found
You run the npm start command and recived the “command not found” error.
Reason : This is caused by missing “Office-addin-debugging” package. NPM looking for this package and can’t find it.
Solution : To install this package type and run npm install office-addin-debugging and that will solve this issue.
Issue 2 : Add-in Error : Sorry, we can’t load the add-in. Please make sure that you have network and/or Internet connectivity. Click “Try Again” Once you’re back online.
Reason : This error occurred when the add-ins are not able to find local server, or the it’s not able to locate the CA certificate.
Solution : Open a new command shell, go to your office add-ins root directory, type and run the below command.
npm run dev-server
Now open another command shell and go to same directory and run npm start.
and it will open the Word and you should be able to see working add-ins and task pane/
Issue 3 : How to convert images and document to Base64 format.
If you are new to MS Office JS development, this is the bit in which you will struggle a bit, to find to how to convert your images to document to base64
In Office JS add-ins you can’t insert JPG or documents directly, you require to convert them to Base64 string first.
Solution : If you are in Mac, simple run the below command and it will convert the file in to Base64 and export it in to a text file.
Cat filename.jpg | base64 > fileName.txr
I hope this blog post may save some of your troubleshooting time.
Please feel free to share and comment if you like this blog post.