title: Angular unit tests are failing only on build server
body: <p>All pull requests circleci pipelines fail while running unit tests.</p>
  <p>Unit tests are successful on local development machine but failing while on build server in Docker Container.</p>
  <p>Error is</p>
  <pre><code>17 12 2020 10:55:35.283:ERROR [karma-server]: UnhandledRejection: Cannot read property 'range' of undefined
  17 12 2020 10:55:35.284:ERROR [karma-server]: TypeError: Cannot read property 'range' of undefined
  </code></pre>
  <p>I tried the solution proposed in this post, but still not working
  <a href="https://ievgen.de/2020/11/17/angular-tests-fail-docker/" rel="nofollow noreferrer">https://ievgen.de/2020/11/17/angular-tests-fail-docker/</a></p>
  <p>Any ideas ?</p>
  <hr />
  <p>CircleCi executor config:</p>
  <pre><code>executors:
    node-lts:
      docker:
        - image: circleci/node:14-browsers
      working_directory: ~/ng
  </code></pre>
  <hr />
  <p>Karma.config:</p>
  <pre><code>module.exports = function (config) {
    config.set({
      basePath: '',
      frameworks: ['jasmine', '@angular-devkit/build-angular'],
      plugins: [
        require('karma-jasmine'),
        require('karma-chrome-launcher'),
        require('karma-jasmine-html-reporter'),
        require('karma-coverage-istanbul-reporter'),
        require('@angular-devkit/build-angular/plugins/karma')
      ],
      client: {
        clearContext: false // leave Jasmine Spec Runner output visible in browser
      },
      coverageIstanbulReporter: {
        dir: require('path').join(__dirname, './coverage/pricetracer'),
        reports: ['html', 'lcovonly', 'text-summary'],
        fixWebpackSourcePaths: true
      },
      reporters: ['progress', 'kjhtml'],
      port: 9876,
      colors: true,
      logLevel: config.LOG_INFO,
      autoWatch: true,
      browsers: ['Chrome'],
      customLaunchers: {
        ChromeHeadlessCI: {
          base: 'ChromeHeadless',
          flags: ['--no-sandbox'],
        },
      },
      singleRun: false,
      restartOnFileChange: true
    });
  };
  </code></pre>