1

I'm doing continuous integration for my Angular (8) App.

Locally, whenever I try to run the "build" for the project, it works just fine. But when my pipeline at Atlassian Bamboo tries to build and run the tests, it's unable to start HeadlessChrome. I found many similar questions, but not one with my exact problem or a solution.

This is the error I'm getting:

Cannot start ChromeHeadless error while loading shared libraries: libXcomposite.so.1: cannot open shared object file: No such file or directory

This is my Karma conf:

module.exports = function (config) {
  const process = require('process');
  process.env.CHROME_BIN = require('puppeteer').executablePath();

  config.set({
    basePath: '',
    frameworks: ['jasmine', '@angular-devkit/build-angular'],
    plugins: [
      ...
    ],
    client: {
      clearContext: false // leave Jasmine Spec Runner output visible in browser
    },
    coverageIstanbulReporter: {
      dir: require('path').join(__dirname, './coverage/idm-ui'),
      reports: ['html', 'lcovonly', 'text-summary'],
      fixWebpackSourcePaths: true
    },
    reporters: ['progress', 'kjhtml'],
    port: 9876,
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['ChromeHeadlessNoSandbox'],
    customLaunchers: {
      ChromeHeadlessNoSandbox: {
        base: 'ChromeHeadless',
        flags: [
          '--no-sandbox',
          '--enable-logging'
        ]
      }
    },
    singleRun: false,
    restartOnFileChange: true
  });
};

And the command I'm running is ng test --watch=false. Also, I have "puppeteer": "^2.1.1" in my package.json.

What am I doing wrong here?

1 Answer 1

2

I managed to fix it. If someone ever has the same problem, the answer is to install these:

https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#chrome-headless-doesnt-launch

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.