OfficeDev / Office-Addin-Scripts

A set of scripts and packages that are consumed in Office add-ins projects.
MIT License
156 stars 100 forks source link

office-addin-debugging 'stop' doesn't work on MacOS #160

Closed andrewconnell closed 5 years ago

andrewconnell commented 5 years ago

On macOS 10.14.5, starting the debugger with npm run start which runs office-addin-debugging start manifest.xml spins up a debugging server but in a detached process. Running npm run stop or office-addin-debugging stop manifest.xml does not stop the process.

The only way I was able to get it to stop was to find the node process that had port 3000 open and kill it with Activity Monitor.

akrantz commented 5 years ago

You can avoid this by starting it with npm run dev-server in a separate Terminal window tab, or if using VS Code, use Terminal, Run Task..., Dev Server to run it inside VS Code. You can then close the Terminal window tab or close VS Code to stop the task.

We've already done some work to know the process id of the detached process which is started. We need office-addin-debugging start to write this to disk so that office-addin-debugging stop can know to stop the process.

andrewconnell commented 5 years ago

Good to know... would have helped me this week. However as it stands now, the stop command doesn't work when it says it successfully completed it's task.

akrantz commented 5 years ago

Yes, I agree. I'm not disputing that. We will work to make improvements here. Sorry if this caused problems for you.

akrantz commented 5 years ago

This is now fixed. I have published office-addin-debugging using the "next" dist-tag, so you install the updated package using "npm install -D office-addin-debugging@next".

jpshankle commented 5 years ago

MacOS still appears to have the problem of getting $ office-addin-debugging stop manifest.xml env: node\r: No such file or directory error Command failed with exit code 127. The way to resolve the issue locally is to change the line ending in .bin -> office-addin-debugging from CRLF to LF.

akrantz commented 5 years ago

@jpshankle I opened a separate issue about that: https://github.com/OfficeDev/Office-Addin-Scripts/issues/168.

akrantz commented 5 years ago

@jpshankle Please see comments in https://github.com/OfficeDev/Office-Addin-Scripts/issues/168. I wasn't able to mention your username there. Not sure why, but please reply there and we will follow up. Thanks.

suuunly commented 5 months ago

This is now fixed. I have published office-addin-debugging using the "next" dist-tag, so you install the updated package using "npm install -D office-addin-debugging@next".

I tried doing so, updating from 5.0.12, to 5.1.0. However, running office-addin-debugging stop manifest.xml still shows webpack in my Activity Monitor. What is more worrying is that it is slowly creeping upwards - suggesting a memory leak.

image
suuunly commented 5 months ago

@akrantz, I found the solution! I need to run the command with sudo! So in my react based office add-in, I have to run sudo npm run stop. Which is the equivalent to sudo office-addin-debugging stop manifest.xml 😁

@andrewconnell, if you haven't found the solution yet, then hopefully this helps :)