Angular fails with Travis with error "Found 1 load error"

here’s my .travis.yml

language: node_js
node_js:
  - "16"

addons:
  chrome: stable

cache:
  directories:
    - ./node_modules
    - ./.angular

install:
  - npm install

script:
  - npm run test -- --code-coverage --no-watch --no-progress --browsers=ChromeHeadlessCI

after_script:
  - cat ./coverage/*/lcov.info | ./node_modules/coveralls/bin/coveralls.js

here’s the exact error:

ERROR [karma-server]: [39mError: Found 1 load error at Server. (/home/travis/build/node_modules/karma/lib/server.js:239:26) at Object.onceWrapper (node:events:509:28) at Server.emit (node:events:402:35) at Server.emit (node:domain:475:12) at emitListeningNT (node:net:1368:10) at processTicksAndRejections (node:internal/process/task_queues:82:21)

need help deploying, company wide project - thank you @montana?

Assuming that you upgraded your project to Angular 13. When I replaced karma-project-name with karma-coverage it works fine.

In karma.conf.js , you should replace coverageIstanbulReporter with coverageReporter as follows:

coverageReporter: {
  dir: require('path').join(__dirname, './coverage/<your-project-name>'),
  subdir: '.',
  reports: [
    { type: 'html' },
    { type: 'lcovonly' },
    { type: 'text-summary' }
  ]
},

In this case the Travis parser can parse this and actually go ahead and deploy a build. This should be the fix, and let your company go back to normal usage. These are nuances and I recommend you watching out for these things in the future and/or reading the Karma documentation.

In the after_script: part of your .travis.yml, it would also make more sense to probably run tail -f instead of cat. This is also mostly true for React, as that’s what I mainly program in (React and Ruby.)

2 Likes