Skip to content

Exit code is null when using headless chrome #16399

@ORESoftware

Description

@ORESoftware
  • Node v6
  • Darwin

I am getting a null exit code after launching and killing a child process. This probably should never happen? It's happening when I launch chrome in headless mode:

When using the 'chrome-launcher' module, everything works normally:

 const cl = require('chrome-launcher');
  cl.launch({
        startingUrl: `http://localhost:${port}/suman_testing?data=${testData}`,
        chromeFlags: []
      })
      .then(c => {

        // c.launcher.chrome is a child process instance
         c.launcher.chrome.once('exit', function(code){
          // exit code is an integer
        });

      });

but when I use headless mode:

 const cl = require('chrome-launcher');
  cl.launch({
        startingUrl: `http://localhost:${port}/suman_testing?data=${testData}`,
        chromeFlags: ['--headless']  // <<< use headless mode <<<
      })
      .then(c => {
         c.launcher.chrome.once('exit', function(code){
          // exit code is null !! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        });
      });

is this expected? I am assuming this should never happen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionIssues that look for answers.wrong repoIssues that should be opened in another repository.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions