OfficeDev / generator-office

Yeoman generator for building Microsoft Office related projects.
https://www.npmjs.com/package/generator-office
MIT License
819 stars 207 forks source link

Dev certificates don't get installed automatically when starting the dev-server #746

Closed alinnert closed 1 year ago

alinnert commented 1 year ago

Prerequisites

Expected behavior

Office Dev Certs get installed when starting the dev-server or I should get prompted to install the certificates.

Current behavior

That doesn't happen. I've struggled making a Word add-in run again after not touching it and the related tools for about one year. Opening the add-in in Word resulted in the error message "ADD-IN ERROR - The content is blocked because it isn't signed by a valid security certificate.". After some trial and error, I found the root of the problem: The certificates ca.crt and localhost.crt get created but there's no attempt to install them. It doesn't matter if I run PowerShell normally or as an Administrator, or if I run npm run dev-server, npm run start:desktop or npx office-addin-dev-certs install. In all cases I need to install those certificates manually. Otherwise, the local certificates store doesn't contain those certificates or only the previous ones which are invalid at that point in time.

I'm pretty sure this wasn't necessary back then when I worked on the add-in the last time. Also, the get started guide does mention such a prompt. Does someone know what could cause the prompt to not show up?

Steps to Reproduce

I think following the get started guide should reproduce the problem. At least I had the same problem with a new project created with npx -p yo@latest -p generator-office@latest yo office and then running npm run dev-server or npm run start:desktop.

Context

Failure Logs

none

millerds commented 1 year ago

A new package was published with some updated to the certificate scripts. Can you try again and see if it is any better?

alinnert commented 1 year ago

Now I was able to try it out. Did you mean office-addin-dev-certs? After upgrading it from 1.9 to 1.11 it works again. Thank you!