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

Move Folder -> Missing Error Handler on Socket? #1988

Closed
oliverspryn opened this issue Mar 12, 2016 · 9 comments
Closed

Move Folder -> Missing Error Handler on Socket? #1988

oliverspryn opened this issue Mar 12, 2016 · 9 comments

Comments

@oliverspryn
Copy link

I have a set of working, valid unit tests for an Angular 2.0 project run by Karma 0.13.22, connecting to a Chrome 48 browser with Socket.io 1.4.5. I was testing under this configuration, which worked:

app/
tests/app
karma-test-shim.js
karma.conf.js

Then, without changing any code, I moved one folder:

source/app/
tests/app
karma-test-shim.js
karma.conf.js

... then I updated karma-test-shim.js and karma.conf.js with the new paths.

Now the tests don't even run, and I get this error:

Missing error handler on `socket`.
TypeError: (msg || "").replace is not a function
  at /home/spryno724/projects/portfolio/node_modules/karma/lib/reporter.js:45:23
  at onBrowserError (/home/spryno724/projects/portfolio/node_modules/karma/lib/reporters/base.js:58:60)
  ... more stack trace ...

11 03 2016 20:24:11.038:WARN [Chrome 48.0.2564 (Windows 10 0.0.0)]: Disconnected (1 times)

Any idea what is causing this? The only thing that changed is the folder path.


A sample from karma.conf.js:

files: [
  // Load Angular 2 dependencies and the SystemJS shim
  { pattern: 'node_modules/angular2/bundles/angular2-polyfills.js', included: true, watched: true },
  { pattern: 'node_modules/systemjs/dist/system.src.js', included: true, watched: true },
  { pattern: 'node_modules/rxjs/bundles/Rx.js', included: true, watched: true },
  { pattern: 'node_modules/angular2/bundles/angular2.dev.js', included: true, watched: true },
  { pattern: 'node_modules/angular2/bundles/testing.dev.js', included: true, watched: true },
  { pattern: 'karma-test-shim.js', included: true, watched: true },

  // The application and test files
  { pattern: 'source/app/**/*.js', included: false, watched: false },
  { pattern: 'test/unit/app/**/*.js', included: false, watched: false },

  // Support for debugging sessions
  { pattern: 'source/app/**/*.ts', included: false, watched: false },
  { pattern: 'test/unit/app/**/*.js.map', included: false, watched: false }
]
@dignifiedquire
Copy link
Member

Take a look at #1969 this sounds very similar and the solution posted there might help you.

@oliverspryn
Copy link
Author

@dignifiedquire Thank you for your feedback. I already checked this issue and am pretty (99%) convinced that this issue is unrelated. I quadruple checked all of my paths to make sure the casing was correct and that the paths were indeed valid. They seem to be just fine.

My associated question on StackOverflow has revealed that others are facing the same issue without avail.

@dignifiedquire
Copy link
Member

looks like this error happens on different failing configs. Could you try and provide me with a sample project that has the same issue?

@oliverspryn
Copy link
Author

@dignifiedquire I appreciate the attention you are giving this issue. You can actually look for yourself at the project which has this issue, at: http://github.com/oliver-spryn/portfolio

All of the karma.conf.js files are under the .config folder. Is that of any help to you?

@dignifiedquire
Copy link
Member

@oliver-spryn I'm afraid that doesn't help. I've cloned the repo and ran the npm testbrowser and testlocal scripts, but they all pass without any errors for me.

@pdelorme
Copy link

@oliver-spryn did you solve the pb ? I'm having the same issue...

@pdelorme
Copy link

When running with PhantomJS, at crash time msgvalue is :

{ stack: null,
  originalErr: 
   { line: 833,
     sourceURL: 'http://localhost:9876/base/node_modules/angular2/bundles/angular2.dev.js?f37cd2b1aaaae47ad6abb1c295764f13c0feaf54',
     stack: 'http://localhost:9876/base/node_modules/angular2/bundles/angular2.dev.js?f37cd2b1aaaae47ad6abb1c295764f13c0feaf54:833:25\nhttp://localhost:9876/base/node_modules/angular2/bundles/angular2.dev.js?f37cd2b1aaaae47ad6abb1c295764f13c0feaf54:848:5\nlinkDynamicModule@http://localhost:9876/base/node_modules/systemjs/dist/system.src.js?18a094f61af9f2ec0577ca3a337760d97719b624:3222:36\ngetModule@http://localhost:9876/base/node_modules/systemjs/dist/system.src.js?18a094f61af9f2ec0577ca3a337760d97719b624:3190:26\nhttp://localhost:9876/base/node_modules/systemjs/dist/system.src.js?18a094f61af9f2ec0577ca3a337760d97719b624:3226:25\nhttp://localhost:9876/base/node_modules/angular2/bundles/angular2.dev.js?f37cd2b1aaaae47ad6abb1c295764f13c0feaf54:23872:29\nlinkDynamicModule@http://localhost:9876/base/node_modules/systemjs/dist/system.src.js?18a094f61af9f2ec0577ca3a337760d97719b624:3222:36\nlink@http://localhost:9876/base/node_modules/systemjs/dist/system.src.js?18a094f61af9f2ec0577ca3a337760d97719b624:3065:28\nexecute@http://localhost:9876/base/node_modules/systemjs/dist/system.src.js?18a094f61af9f2ec0577ca3a337760d97719b624:3402:17\ndoDynamicExecute@http://localhost:9876/base/node_modules/systemjs/dist/system.src.js?18a094f61af9f2ec0577ca3a337760d97719b624:796:32\nlink@http://localhost:9876/base/node_modules/systemjs/dist/system.src.js?18a094f61af9f2ec0577ca3a337760d97719b624:998:36\ndoLink@http://localhost:9876/base/node_modules/systemjs/dist/system.src.js?18a094f61af9f2ec0577ca3a337760d97719b624:650:11\nupdateLinkSetOnLoad@http://localhost:9876/base/node_modules/systemjs/dist/system.src.js?18a094f61af9f2ec0577ca3a337760d97719b624:698:24\nhttp://localhost:9876/base/node_modules/systemjs/dist/system.src.js?18a094f61af9f2ec0577ca3a337760d97719b624:510:30\ninvoke@http://localhost:9876/base/node_modules/angular2/bundles/angular2-polyfills.js?515e45a0cf377eb121bfd453f38a79b8d69bce25:332:34\nrun@http://localhost:9876/base/node_modules/angular2/bundles/angular2-polyfills.js?515e45a0cf377eb121bfd453f38a79b8d69bce25:227:50\nhttp://localhost:9876/base/node_modules/angular2/bundles/angular2-polyfills.js?515e45a0cf377eb121bfd453f38a79b8d69bce25:576:61\ninvokeTask@http://localhost:9876/base/node_modules/angular2/bundles/angular2-polyfills.js?515e45a0cf377eb121bfd453f38a79b8d69bce25:365:43\nrunTask@http://localhost:9876/base/node_modules/angular2/bundles/angular2-polyfills.js?515e45a0cf377eb121bfd453f38a79b8d69bce25:263:58\ndrainMicroTaskQueue@http://localhost:9876/base/node_modules/angular2/bundles/angular2-polyfills.js?515e45a0cf377eb121bfd453f38a79b8d69bce25:482:43\ninvoke@http://localhost:9876/base/node_modules/angular2/bundles/angular2-polyfills.js?515e45a0cf377eb121bfd453f38a79b8d69bce25:434:41' },
  line: 821,
  sourceURL: 'http://localhost:9876/base/node_modules/systemjs/dist/system.src.js?18a094f61af9f2ec0577ca3a337760d97719b624' }

@unlight
Copy link

unlight commented Apr 16, 2016

I had same issue with latest systemjs (no idea why it affects). After I downgraded systemjs to 0.19.6 error is gone.

@phhoangbao
Copy link

phhoangbao commented Apr 24, 2016

@oliver-spryn you try to change your karma-test-shim.js. Under System.config, change format: 'register' to format: 'cjs'
Simple proj @https://github.com/phhoangbao/angular2-test to simulate same issue as you.

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

5 participants