Running `netlify dev` in postBuild causes lingering processes warning

In my project, I have a _headers file that contains some important headers that I want to ensure my site has when deployed. I have a number of Cypress tests that verify the headers and I’m trying to get them to run in Netlify postBuild. In order to do this, I’m using the Netlify CLI command netlify dev to serve the built files (the files built by Netlify itself) and it will also pick up the _headers file and return them when hitting the locally running server.

I’ve managed to get this all running fine and all the tests are passing as expected. However, in the Netlify build logs, I’m getting a warning of There are some lingering processes even after the build process finished:. I’m making sure I kill the process when I’m finished with it and I’ve even logged it out to check and I can see that it’s been killed before the plugin finishes executing.

Am I missing something? When does the lingering process check happen, is it after all the postBuild plugins?

I found this comment on GitHub that states the process check is happening after build but this is in the postBuild so I’m not sure why it’s reporting it. - Lingering process `[node]` · Issue #1932 · netlify/build · GitHub

Hi @alexjfno1,

Thanks for reporting this.
Is the issue you’re reporting the one described here? If so, I would suggest following that thread as there is an ongoing discussion on how to solve this.

Thanks @ehmicky. That looks like the same issue, thanks for pointing me to it.

Hi @alexjfno1,

Are you still experience this problem?

We’ve just released some improvements to this warning message which should make it clearer.

We’ve also added a support guide to explain why this message appears and how to remove it. Please note that this is just a warning message, it does not impact your build in any way.