Skip to content

TypeError: Cannot read property 'isValidUTF8' of undefined #2777

@kevinsalter

Description

@kevinsalter

Expected behaviour

The test runner runs successfully.

Actual behaviour

An error is thrown when running karma start karma.conf.js --single-run in an Angular 2.4.7 project.

17 07 2017 14:37:25.450:INFO [karma]: Karma v1.7.0 server started at http://0.0.0.0:9876/
17 07 2017 14:37:25.450:INFO [launcher]: Launching browser Chrome with unlimited concurrency
17 07 2017 14:37:25.457:INFO [launcher]: Starting browser Chrome
17 07 2017 14:37:26.898:ERROR [karma]: TypeError: Cannot read property 'isValidUTF8' of undefined
    at /Users/kevinsalter/code/esportspools/resources/assets/site/node_modules/karma/node_modules/ws/lib/Receiver.js:532:28
    at /Users/kevinsalter/code/esportspools/resources/assets/site/node_modules/karma/node_modules/ws/lib/Receiver.js:368:7
    at /Users/kevinsalter/code/esportspools/resources/assets/site/node_modules/karma/node_modules/ws/lib/PerMessageDeflate.js:249:5
    at afterWrite (_stream_writable.js:385:3)
    at onwrite (_stream_writable.js:376:7)
    at WritableState.onwrite (_stream_writable.js:90:5)
    at afterTransform (_stream_transform.js:79:3)
    at TransformState.afterTransform (_stream_transform.js:54:12)
    at Zlib.callback (zlib.js:639:5)

Environment Details

Here are all packages in package.json of the project

"dependencies": {
    "@angular/common": "2.4.7",
    "@angular/compiler": "2.4.7",
    "@angular/core": "2.4.7",
    "@angular/forms": "2.4.7",
    "@angular/http": "2.4.7",
    "@angular/platform-browser": "2.4.7",
    "@angular/platform-browser-dynamic": "2.4.7",
    "@angular/router": "3.4.7",
    "@angular/upgrade": "2.4.7",
    "@ng-bootstrap/ng-bootstrap": "1.0.0-alpha.14",
    "angular2-swiper": "0.8.1",
    "core-js": "2.4.1",
    "intl": "1.2.5",
    "ng2-lazyload-image": "2.4.0",
    "reflect-metadata": "0.1.10",
    "rxjs": "5.4.0",
    "swiper": "3.4.2",
    "systemjs": "0.19.39",
    "ui-cropper": "1.0.4",
    "zone.js": "0.7.8"
  },
  "devDependencies": {
    "@types/core-js": "0.9.36",
    "@types/jasmine": "2.5.51",
    "@types/lodash": "4.14.51",
    "@types/node": "4.2.11",
    "apache-server-configs": "2.14.0",
    "awesome-typescript-loader": "3.1.3",
    "clean-webpack-plugin": "0.1.16",
    "concurrently": "3.4.0",
    "connect-modrewrite": "0.8.5",
    "grunt": "0.4.5",
    "grunt-autoprefixer": "1.0.1",
    "grunt-concurrent": "0.5.0",
    "grunt-contrib-clean": "0.6.0",
    "grunt-contrib-concat": "0.5.1",
    "grunt-contrib-connect": "0.8.0",
    "grunt-contrib-copy": "0.5.0",
    "grunt-contrib-cssmin": "0.10.0",
    "grunt-contrib-htmlmin": "0.4.0",
    "grunt-contrib-imagemin": "0.8.1",
    "grunt-contrib-jshint": "0.10.0",
    "grunt-contrib-less": "1.4.1",
    "grunt-contrib-uglify": "0.9.2",
    "grunt-contrib-watch": "0.6.1",
    "grunt-mocha": "0.4.15",
    "grunt-modernizr": "0.5.2",
    "grunt-newer": "0.7.0",
    "grunt-ng-annotate": "2.0.2",
    "grunt-rev": "0.1.0",
    "grunt-svg-sprite": "1.3.7",
    "grunt-svgmin": "0.4.0",
    "grunt-systemjs-builder": "0.2.7",
    "grunt-ts": "5.5.1",
    "grunt-usemin": "2.6.2",
    "grunt-wiredep": "1.9.0",
    "jasmine-core": "2.6.3",
    "jit-grunt": "0.9.1",
    "jshint-stylish": "0.4.0",
    "karma": "1.7.0",
    "karma-chrome-launcher": "2.1.1",
    "karma-cli": "1.0.1",
    "karma-htmlfile-reporter": "0.3.5",
    "karma-jasmine": "1.1.0",
    "karma-jasmine-html-reporter": "0.2.2",
    "load-grunt-tasks": "0.4.0",
    "localforage": "1.5.0",
    "lodash": "4.17.4",
    "ng2-file-upload": "1.2.1",
    "spawn-sync": "1.0.15",
    "time-grunt": "0.4.0",
    "typescript": "2.1.6",
    "webpack": "2.6.1",
    "webpack-livereload-plugin": "0.9.0",
    "webpack-merge": "1.1.2"
  },
  • Karma version: 1.7.0
  • I'm using the following plugins in karma.config.js
plugins: [
            require('karma-jasmine'),
            require('karma-chrome-launcher'),
            require('karma-jasmine-html-reporter'), // click "Debug" in browser to see it
            require('karma-htmlfile-reporter') // crashing w/ strange socket error
        ],

Steps to reproduce the behaviour

  1. run karma start karma.conf.js --single-run

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