问题
I'm trying to run Outlook-add-in using npm start
. But it gives me an error that
Sideloading the Office Add-in...
Error: Unable to start debugging.
Error: Unable to sideload the Office Add-in.
Error: Sideload is not supported.
I'm running direct demo project which Microsoft provided for Outlook-add-in. Also rund npm run dev-server
before npm start
as i'm running in mac.
https://docs.microsoft.com/en-us/outlook/add-ins/quick-start?tabs=yeomangenerator
I have done some research to find the issue but unable to come up with any. Any help would be grateful.
回答1:
I'm not sure if this has been answered already, but I had the same issue. I used the following link to enable side-loading: Sideload Outlook plugins for testing
Once you have that enabled, you should be able to at least run the dev-server and work with the plugin:
npm run dev-server
回答2:
I'm facing the same issue and after some research I found out the Outlook is not supported, only Excel, PowerPoint and Word can be debugged on desktop.
回答3:
For developers on Mac, it is recommended using Node Version Manager to install Node.js
with the right permissions.
Also, you need to make sure the certificate is installed correctly.
Run this command: npx office-addin-dev-certs install
.
If the certificates are already installed, you'll see a message:
You already have trusted access to https://localhost.
If the certificates are not installed, it will show a message:
The developer certificates have been generated in ...
Installing CA certificate "Developer CA for Microsoft Office Add-ins"...
You should then see the dialog asking to install the certificate.
After saying yes, it should then show:
You now have trusted access to https://localhost.
Once the certificates are installed, you should be able to run the dev server without problems.
See Unable to start the dev server for more information.
回答4:
If you want to test with Office 365 for desktop, you install it as you do with web. If it's installed on your Outlook web account, it should show up on your Outlook 365 Desktop app when you're logged in there.
Some gotchas:
- There is not "Get add-ons" or "Store" link on the ribbon in 365 – you just use https://outlook.office.com/ to install addons (easiest to follow the link from File→Manage addons which will open your browser)
- You may have to restart Outlook after adding new add-ins from your browser
- Make sure you've got activated "optional connected experiences" – if this is unticked, the buttons won't show up in the ribbons at all!
- On the web, there is no ribbon – you have to click the "…" on a message to see your addon at the bottom of a long menu :-(
回答5:
I experienced the same issue when updating npm packages. I tried the following:
npm run dev-server
It resulted in an error:
> office-addin-taskpane-js@0.0.1 dev-server [path to addin]
> webpack-dev-server --mode development
TypeError: CleanWebpackPlugin is not a constructor
at module.exports ([path to addin]\webpack.config.js:58:4)
at handleFunction ([path to addin]\node_modules\webpack-cli\bin\utils\prepareOptions.js:21:13)
at prepareOptions ([path to addin]\node_modules\webpack-cli\bin\utils\prepareOptions.js:9:5)
at requireConfig ([path to addin]\node_modules\webpack-cli\bin\utils\convert-argv.js:117:14)
at [path to addin]\node_modules\webpack-cli\bin\utils\convert-argv.js:123:17
at Array.forEach (<anonymous>)
at module.exports ([path to addin]\node_modules\webpack-cli\bin\utils\convert-argv.js:121:15)
at Object.<anonymous> ([path to addin]\node_modules\webpack-dev-server\bin\webpack-dev-server.js:84:40)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:10)
at startup (internal/bootstrap/node.js:238:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:572:3)
So I opened webpack.config.js
and changed the require of the CleanWebpackPlugin
to destructuring syntax (I added the curly brackets):
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
Now after starting with npm start
I still see the sideload error, but the add in started working again. I'm not sure what the problem is, but maybe this might lead you in the right direction for a solution.
来源:https://stackoverflow.com/questions/57743701/unable-to-sideload-the-office-add-in-when-running-npm-start