Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zombie esbuild processes #643

Closed
mhanberg opened this issue Jan 5, 2021 · 5 comments
Closed

Zombie esbuild processes #643

mhanberg opened this issue Jan 5, 2021 · 5 comments

Comments

@mhanberg
Copy link

mhanberg commented Jan 5, 2021

I can't seem to run the esbuild with the --serve functionality without leaving a zombie esbuild process when I stop it.

I have tried using the CLI and using the JS API, both seem to leave a zombie process.

This is what I've tried with the JS API so far.

const baseConfig = {
  entryPoints: ['./js/app.js', './css/app.css'],
  target: "es2015",
  bundle: true,
  outdir: "../priv/static",
  plugins: [PostCSSPlugin] // plugin defined earlier in the script
};

function onRequest({ path }) {
  console.log(`building ${path}`);
}

esbuild.serve({ onRequest }, baseConfig)
  .then(server => {
    console.log("Server running for esbuild");

    process.on("exit", code => {
      console.log(`stopping the server with exit code ${code}`);

      server.stop();
    });
  })
  .catch(() => {
    console.log("Crashing esbuild");

    return process.exit(1)
  });

Any ideas?

@evanw
Copy link
Owner

evanw commented Jan 6, 2021

I can't reproduce this. What platform are you on? And how are you stopping it? Does it happen without the plugin?

@mhanberg
Copy link
Author

  • This is on macOS.
  • started as a "watcher" with the Phoenix web framework (elixir).
  • I ctrl-c out of the phoenix dev server. it starts the esbuild process via an erlang port, not sure exactly how that get's shut down
  • I do see it without the plugin

My priorities have shifted and I don't have the time to see this through. I'll close this and circle back if I find some time.

Thanks for your response 🙇.

evanw added a commit that referenced this issue Feb 1, 2021
evanw added a commit that referenced this issue Feb 1, 2021
@evanw
Copy link
Owner

evanw commented Feb 1, 2021

Well I think I finally got it. I came across it due to some other work. It was a stray ! of all things.

@mhanberg
Copy link
Author

mhanberg commented Feb 2, 2021

I'll update and see if it's fixed on my end. Thanks for your work on this!

@mhanberg
Copy link
Author

mhanberg commented Feb 2, 2021

Looks good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants