Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property * of null when using grunt watch #2218

Open
mcgraphix opened this issue Jun 29, 2016 · 3 comments
Open

Cannot read property * of null when using grunt watch #2218

mcgraphix opened this issue Jun 29, 2016 · 3 comments

Comments

@mcgraphix
Copy link

Expected behavior

Tests should rerun successfully

Actual behavior

Error thrown to console:

Missing error handler on `socket`.

Done.
TypeError: Cannot read property '27391504' of null
  at [object Object].onBrowserComplete (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/karma-htmlfile-reporter/index.js:97:23)
  at [object Object].<anonymous> (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/karma/lib/events.js:13:22)
  at emitTwo (events.js:105:20)
  at [object Object].emit (events.js:185:7)
  at [object Object].onComplete (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/karma/lib/browser.js:143:13)
  at Socket.<anonymous> (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/karma/lib/events.js:13:22)
  at emitTwo (events.js:105:20)
  at Socket.emit (events.js:185:7)
  at Socket.onevent (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/socket.io/lib/socket.js:335:8)
  at Socket.onpacket (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/socket.io/lib/socket.js:295:12)
  at Client.ondecoded (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/socket.io/lib/client.js:193:14)
  at Decoder.Emitter.emit (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/component-emitter/index.js:134:20)
  at Decoder.add (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/socket.io-parser/index.js:247:12)
  at Client.ondata (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/socket.io/lib/client.js:175:18)
  at emitOne (events.js:90:13)
  at Socket.emit (events.js:182:7)
  at Socket.onPacket (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/engine.io/lib/socket.js:101:14)
  at emitOne (events.js:90:13)
  at WebSocket.emit (events.js:182:7)
  at WebSocket.Transport.onPacket (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/engine.io/lib/transport.js:104:8)
  at WebSocket.Transport.onData (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/engine.io/lib/transport.js:115:8)
  at WebSocket.onData (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/engine.io/lib/transports/websocket.js:76:30)
  at emitTwo (events.js:100:13)
  at WebSocket.emit (events.js:185:7)
  at Receiver.ontext (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/ws/lib/WebSocket.js:816:10)
  at /Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/ws/lib/Receiver.js:477:18
  at Receiver.applyExtensions (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/ws/lib/Receiver.js:364:5)
  at /Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/ws/lib/Receiver.js:466:14
  at Receiver.flush (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/ws/lib/Receiver.js:340:3)
  at Receiver.opcodes.1.finish (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/ws/lib/Receiver.js:482:12)
  at Receiver.expectHandler (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/ws/lib/Receiver.js:451:33)
  at Receiver.add (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/ws/lib/Receiver.js:95:24)
  at Socket.realHandler (/Users/mckeowr/Documents/git/streamline-dh/vsldh-ui/node_modules/ws/lib/WebSocket.js:800:20)
  at emitOne (events.js:90:13)
  at Socket.emit (events.js:182:7)
  at readableAddChunk (_stream_readable.js:153:18)
  at Socket.Readable.push (_stream_readable.js:111:10)
  at TCP.onread (net.js:529:20)

PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR

Enviroment Details

  • Karma version (output of karma --version): 1.1.0 (this issue doesn't happen with 1.0.0)
  • Relevant part of your karma.config.js file:
frameworks: ['jasmine'],
        plugins: ['karma-jasmine', 'karma-firefox-launcher', 'karma-chrome-launcher', 'karma-phantomjs-launcher', 'karma-coffee-preprocessor', 'karma-ng-html2js-preprocessor', 'karma-htmlfile-reporter', 'karma-coverage'],
        preprocessors: {
            'src/app/**/*.tpl.html': 'ng-html2js',
            'src/**/!(*\.spec).js': 'coverage'
        },
        reporters: ['html', 'coverage', 'progress'],
        htmlReporter: {
            outputFile: 'build/tests/test-results.html'
        },
        coverageReporter: {
            type: 'html',
            dir: 'build/coverage/'
        },
        browsers: ['PhantomJS']
  • plugins from package.json:
    "grunt":"1.0.1",
    "grunt-bump": "0.8.0",
    "grunt-contrib-clean": "1.0.0",
    "grunt-contrib-concat": "1.0.1",
    "grunt-contrib-copy": "1.0.0",
    "grunt-contrib-jshint": "1.0.0",
    "grunt-contrib-less": "1.3.0",
    "grunt-contrib-uglify": "1.0.1",
    "grunt-contrib-watch": "1.0.0",
    "grunt-conventional-changelog": "6.1.0",
    "grunt-express": "1.4.1",
    "grunt-html2js": "0.3.6",
    "grunt-karma": "2.0.0",
    "grunt-ngmin": "0.0.3",
    "grunt-open": "0.2.3",
    "grunt-parallel": "^0.5.1",
    "grunt-recess": "1.0.1",
    "grunt-karma": "2.0.0",
    "jasmine-core": "2.4.1",
    "karma": "1.1.0",
    "karma-chrome-launcher": "0.2.2",
    "karma-coffee-preprocessor": "*",
    "karma-coverage": "0.5.5",
    "karma-firefox-launcher": "0.1.7",
    "karma-html2js-preprocessor": "0.1.0",
    "karma-htmlfile-reporter": "0.2.2",
    "karma-jasmine": "0.3.7",
    "karma-ng-html2js-preprocessor": "0.2.1",
    "karma-phantomjs-launcher": "^1.0.0",
    "karma-requirejs": "0.2.5",
    "karma-script-launcher": "0.2.0",
    "phantomjs-prebuilt": "2.1.7"

Steps to reproduce the behaviour

1.run grunt watch - tests run successfully
2. change a test file
3. it attempts to rerun but throws error (shown above)

Keeping all the dependencies and configuration the same and just downgrading karma to 1.0.0 prevents the issue.

@main-kun
Copy link

main-kun commented Jul 3, 2016

Getting the same error on 1.1.0, except I don't use grunt and simply use karma start.
The error doesn't happen on 1.0.0
Os is OSX El Capitan

Console error i get:

Missing error handler on `socket`.
TypeError: Cannot read property '92954867' of null
    at onBrowserComplete (/Users/woolywhale/Work/FrontendV2/node_modules/karma-junit-reporter/index.js:120:23)
    at null.<anonymous> (/Users/woolywhale/Work/FrontendV2/node_modules/karma/lib/events.js:13:22)
    at emitTwo (events.js:105:20)
    at emit (events.js:185:7)
    at onComplete (/Users/woolywhale/Work/FrontendV2/node_modules/karma/lib/browser.js:143:13)
    at Socket.<anonymous> (/Users/woolywhale/Work/FrontendV2/node_modules/karma/lib/events.js:13:22)
    at emitTwo (events.js:105:20)
    at Socket.emit (events.js:185:7)
    at Socket.onevent (/Users/woolywhale/Work/FrontendV2/node_modules/socket.io/lib/socket.js:335:8)
    at Socket.onpacket (/Users/woolywhale/Work/FrontendV2/node_modules/socket.io/lib/socket.js:295:12)
    at Client.ondecoded (/Users/woolywhale/Work/FrontendV2/node_modules/socket.io/lib/client.js:193:14)
    at Decoder.Emitter.emit (/Users/woolywhale/Work/FrontendV2/node_modules/component-emitter/index.js:134:20)
    at Decoder.add (/Users/woolywhale/Work/FrontendV2/node_modules/socket.io-parser/index.js:247:12)
    at Client.ondata (/Users/woolywhale/Work/FrontendV2/node_modules/socket.io/lib/client.js:175:18)
    at emitOne (events.js:90:13)
    at Socket.emit (events.js:182:7)
03 07 2016 16:48:18.339:WARN [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Disconnected (1PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
  Disconnectedundefined
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 45 of 45 SUCCESS (0.173 secs / 0.281 secs)
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
  Disconnectedundefined
03 07 2016 16:48:28.337:WARN [PhantomJS 2.1.1 (Mac OS X 0.0.0)]: Disconnected (2PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
  Disconnected, because no message in 10000 ms.
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 45 of 45 DISCONNECTED (10.174 secs / 0.281 secs)
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 45 of 45 DISCONNECTED (10.174 secs / 0.281 secs)
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 45 of 45 DISCONNECTED (10.174 secs / 0.281 secs)
03 07 2016 16:48:28.338:ERROR [karma]: [TypeError: Cannot read property '92954867' of null]
TypeError: Cannot read property '92954867' of null
    at onBrowserComplete (/Users/woolywhale/Work/FrontendV2/node_modules/karma-junit-reporter/index.js:120:23)
    at null.<anonymous> (/Users/woolywhale/Work/FrontendV2/node_modules/karma/lib/events.js:13:22)
    at emitOne (events.js:95:20)
    at emit (events.js:182:7)
    at Timeout._onTimeout (/Users/woolywhale/Work/FrontendV2/node_modules/karma/lib/browser.js:51:15)
    at tryOnTimeout (timers.js:224:11)
    at Timer.listOnTimeout (timers.js:198:5)

@stramel
Copy link

stramel commented Jul 22, 2016

#1292

@wesleycho
Copy link
Member

wesleycho commented Dec 13, 2016

@main-kun your issue should be fixed by the latest release of karma-junit-reporter, 1.2.0.

@mcgraphix a mitigating fix can probably be done to karma-htmlfile-reporter similar to the patch to karma-junit-reporter recently done, but the root of the issue in karma itself is #1292 as mentioned by @stramel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants