Missing error handler on `socket`. TypeError: (msg || "").replace is not a function Error
See original GitHub issueI’m getting the above error when I try to run jenkins jobs using karma. Any ideas what could be causing this?
Expected behavior
karma runs angular2 tests on jenkins, they run fine on desktop.
Actual behavior
`Missing error handler on `socket`.
TypeError: (msg || "").replace is not a function
at /home/hudson/.hudson/jobs/workspace/example/node_modules/karma/lib/reporter.js:45:23
at onBrowserError (/home/hudson/.hudson/jobs/workspace/example/node_modules/karma/lib/reporters/base.js:58:60)
at null.<anonymous> (/home/hudson/.hudson/jobs/workspace/example/node_modules/karma/lib/events.js:13:22)
at emitTwo (events.js:100:13)
at emit (events.js:185:7)
at onKarmaError (/home/hudson/.hudson/jobs/workspace/example/node_modules/karma/lib/browser.js:95:13)
at Socket.<anonymous> (/home/hudson/.hudson/jobs/workspace/example/node_modules/karma/lib/events.js:13:22)
at emitOne (events.js:95:20)
at Socket.emit (events.js:182:7)
at Socket.onevent (/home/hudson/.hudson/jobs/workspace/example/node_modules/socket.io/lib/socket.js:335:8)
at Socket.onpacket (/home/hudson/.hudson/jobs/workspace/example/node_modules/socket.io/lib/socket.js:295:12)
at Client.ondecoded (/home/hudson/.hudson/jobs/workspace/example/node_modules/socket.io/lib/client.js:193:14)
at Decoder.Emitter.emit (/home/hudson/.hudson/jobs/workspace/example/node_modules/component-emitter/index.js:134:20)
at Decoder.add (/home/hudson/.hudson/jobs/workspace/example/node_modules/socket.io-parser/index.js:247:12)
at Client.ondata (/home/hudson/.hudson/jobs/workspace/example/node_modules/socket.io/lib/client.js:175:18)
at emitOne (events.js:90:13)`
Enviroment Details
- Karma version (output of
karma --version
): - Relevant part of your
karma.config.js
file - node --version v5.7.0
- npm --version 3.6.0 karma version 0.13.21
Steps to reproduce the behaviour
- run tests in jenkins, (independent of the tests running) the above stacktrace is displayed
Issue Analytics
- State:
- Created 8 years ago
- Reactions:6
- Comments:20 (2 by maintainers)
Top Results From Across the Web
Missing error handler on `socket`. TypeError: (msg || "").replace is ...
I am getting following error on running unit test in angular2.I am using angular cli as build tool.Karma for unit testing.Any body can...
Read more >Missing error handler on socket - Simon Richard Eames
Missing error handler on `socket `. TypeError: (msg || "").replace is not a function at ...
Read more >karma-runner/karma - Gitter
I am getting the following error message. Missing error handler on socket . TypeError: (msg || "").replace is not a function
Read more >SyntaxError: missing ) after argument list - JavaScript | MDN
The JavaScript exception "missing ) after argument list" occurs when there is an error with how a function is called. This might be...
Read more >"TypeError: require(...).listen is not a function" in socket.io
In this video I have shown " TypeError : require(...).listen is not a function "that you might face with connecting to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i fixed this locally by adding the following lines to
karma/lib/reporter.js
@ line 45:so at least there’s output
@dignifiedquire there’s still a problem to be fixed and that is the error message. It is very unhelpful and it would be very much appreciated by the community, I’m guessing, if the quality of that was improved. As shown here, the problem was a missing file. A missing file error would be much more appropriate and helpful to users.
Update: My problem was IntelliJ messing up imports in a spec. It couldn’t handle angular2 dependencies properly and gave the wrong path. Build worked fine, but testing failed.