-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Missing error handler on socket
. TypeError: (msg || "").replace is not a function Error
#1969
Missing error handler on socket
. TypeError: (msg || "").replace is not a function Error
#1969
Comments
Just giving an update on this issue, I eventually got console access to the build server and found the root cause of this issue. In my files section I had the following entry
The file name is actually Rx.js and not rx.js, this was not a problem with case insensitive windows. Fixing the filename case and everything is now consistent.
I appreciate any time anyone spent on this issue till now. Turns out the exception I focused in on was a symptom of the file not being found. Thanks |
Thanks for the update, and happy to hear you were able to fix it. |
@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. |
I have the same problem, but I already have Rx.js file with capital R. (And I'm using my desktop computer with Windows). What else could cause this problem? |
I can answer that question: traceur-runtime.js Or rather, the lack of it. For some bizarre reason, without the traceur-runtime.js in the mix PhantomJS blows up badly while trying to run Angular2 unit tests. This doesn't seem to be a Karma thing at all, but I thought I'd mention it here so some people could fix their problem. I installed it via bower ("bower install traceur-runtime") and included it in my karma.conf.js ("{pattern: 'bower_components/traceur-runtime/traceur-runtime.js', included: true, watched: true}") and magically PhantomJS suddenly worked just as well as Chrome had. |
I had this problem a few times. I managed to fix this by checking the |
@JohnMunsch shouldn't es6-shim make up for that? I'm also just getting "module is not defined" if I include it in the karma.conf.js files |
I'm getting this error if I run my Karma tests from the console opened inside WebStorm IDE. The same configuration runs fine from the Terminal window on my Mac OS. |
@Cuel I agree, you would think that es6-shim would cover everything. But I'm not the first to find that traceur-runtime had to be added back to the mix in order for PhantomJS to work. |
If you don't want to use traceur-runtime you could try core.js which karma uses itself. |
@yfain same story here, but on Windows with IntelliJ: I get this error when I try to run the command from IntelliJ console, but it runs just fine when executed from Powershell. I'm opening a ticket with Jetbrains now, |
I get this error when i add 'browserify' to preprocessors.
I was getting require not found when running karma, that made me add browserify, now i get this error. |
I think this is really a bug somewhere, though I'm not sure where. return function (msg, indentation) {
// remove domain and timestamp from source files
// and resolve base path / absolute path urls into absolute path
// ---
if (msg && typeof(msg) !== 'string') {
console.error('msg', msg);
}
// ---
msg = (msg || '').replace(URL_REGEXP, function (_, prefix, path, __, ___, line, ____, column) { For my particular case it tells me that some error occured in SystemJS, though It doesn't tell more. The actual fix would be either not to assume here that msg is a string, or maybe the browsers should send objects as error messages. |
i fixed this locally by adding the following lines to
so at least there's output |
I faced this issue when I use node-forge with my angular 2 application. system.config.js karma.config.js This issue happened for me because the dependency path has not set properly |
thats probably because msg became an array of strings, I'll look up into it later today |
@nonmanifold Issue has fixed for me |
I am also getting the same issue..Tried many options but everything failed :( :( ---------------karma-test-shim ---------------------- karma.loaded = function () { function isJsFile(path) { function isSpecFile(path) { function isBuiltFile(path) { function excludeLibFile(path) { var allSpecFiles = Object.keys(window.karma.files) // Load our SystemJS configuration.
}, Promise.all([ testing.TestBed.initTestEnvironment(testingBrowser.BrowserDynamicTestingModule, }).then(function() { }).then(karma.start, karma.error);
}) Can anyone correct me...... |
@saranyapm Hey karma.config.js please try this |
@dileepkeeppalli No..No such module. Now I am trying only with app component. Still I am facing the same issue. |
I'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
Enviroment Details
karma --version
):karma.config.js
filev5.7.0
3.6.0
karma version
0.13.21
Steps to reproduce the behaviour
The text was updated successfully, but these errors were encountered: