Skip to content

Chrome can remain running after the exporter process is forcibly stopped #687

Closed

Description

@daniatic

Expected behaviour

Applications that own the browser should be able to make it terminate with the Node process, including when a forced termination prevents graceful cleanup callbacks from running.

Actual behaviour

On Windows, forcibly stopping a Node process that initialized highcharts-export-server@6.0.0 can leave chrome-headless-shell.exe running after Node has exited. The leftover browser consumes resources and may keep its user data directory in use, interfering with a later exporter launch using the same directory.

The export server has no normal puppeteer.pipe setting. Extra Puppeteer launch options are currently forwarded through the debug configuration only when debug mode is enabled. Using that path requires changing browser debug mode, headless settings, and the debugging port.

Reproduction steps

  1. Start a Node application that calls exporter.initExport() and wait for the browser to start.
  2. Forcibly terminate that Node process, for example with Stop-Process -Id <pid> -Force in PowerShell.
  3. Check whether its chrome-headless-shell.exe process remains running.

In our local comparison, Chrome survived with WebSocket transport and exited with its Node owner when Puppeteer's pipe transport was enabled. The existing --pipe entry in puppeteer.args does not select Puppeteer's pipe transport.

Proposed resolution

Expose an opt-in puppeteer.pipe option, validate an environment variable such as PUPPETEER_PIPE, and pass the value to puppeteer.launch(). Keeping the default false preserves existing behavior for consumers that need WebSocket transport and its debugging endpoint.

Proposed fix: #688.

Activity

  1. daniatic commented on Oct 5, 2026

    @daniatic
    Author

    Closing after correcting the Windows diagnosis. Our reproduction used @puppeteer/browsers 3.2.1, whose detached Windows launch caused the browser to survive forced termination of Node. Version 3.2.2 restores non-detached Windows launches, as fixed in puppeteer/puppeteer#15415.

    With the original, unpatched exporter bundle and WebSocket transport, three local forced-termination checks using 3.2.2 left zero browser processes running. These covered full Chrome and Chrome Headless Shell. Pipe transport is therefore unnecessary for the reported Windows failure, and we are withdrawing #688.

    Puppeteer 25.10.0 and 25.11.0 include @puppeteer/browsers 3.2.2. Raising the exporter's minimum Puppeteer version and refreshing its lockfile would exclude the affected Puppeteer 25.8.0 and 25.9.0 releases. Issue #686 already requests an update to Puppeteer 25.11.0 or newer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions