-
Notifications
You must be signed in to change notification settings - Fork 108
ERROR [karma-server]: UnhandledRejection when updated to 5.0 #367
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
Comments
Do you have an example repo? |
@erikbarke I have the exact same issue, and when adding an error handler as suggested in karma-runner/karma#3378 (comment) (@rinick perhaps you can also do that to trouble shoot your problem), I'm able to see the actual error:
The code that fails is this line: https://github.com/karma-runner/karma/blob/a673aa8ad76f733565498f2aab13fcd720502be1/lib/reporters/multi.js#L11 because the Another thing that I have different compared to your Angular demo is the version of |
my issue is resolved, thanks to @christophercr 's suggestion. the issue is caused by lvoconly report
I guess it was a bug in previous version, even I ask for filename karma, previous version still generated another layer of karma subfolder, then put lcov result in it. latest version actually fixed it, but it failed to write to that file, because a folder with same name already exists. after deleting the folder the UnhandledRejection is gone |
Thanks guys, I've been able to reproduce at least the error @rinick gets by creating a folder with the same name as the lcov file and using the infrastructure_error Error: EISDIR: illegal operation on a directory, open '/Users/erikbarke/Development/npm/monounity/karma-typescript/examples/angular2/coverage/chrome/karma'
at Object.openSync (fs.js:457:3)
at FileWriter.writeFile (/Users/erikbarke/Development/npm/monounity/karma-typescript/examples/angular2/node_modules/istanbul-lib-report/lib/file-writer.js:185:41)
at LcovOnlyReport.onStart (/Users/erikbarke/Development/npm/monounity/karma-typescript/examples/angular2/node_modules/istanbul-reports/lib/lcovonly/index.js:17:45)
at Visitor.value (/Users/erikbarke/Development/npm/monounity/karma-typescript/examples/angular2/node_modules/istanbul-lib-report/lib/tree.js:38:38)
at ReportTree.visit (/Users/erikbarke/Development/npm/monounity/karma-typescript/examples/angular2/node_modules/istanbul-lib-report/lib/tree.js:126:17)
at LcovOnlyReport.execute (/Users/erikbarke/Development/npm/monounity/karma-typescript/examples/angular2/node_modules/istanbul-lib-report/lib/report-base.js:12:44)
at /Users/erikbarke/Development/npm/monounity/karma-typescript/examples/angular2/node_modules/karma-typescript/src/karma/reporter.ts:79:30
at Array.forEach (<anonymous>)
at Reporter.create.<anonymous> (/Users/erikbarke/Development/npm/monounity/karma-typescript/examples/angular2/node_modules/karma-typescript/src/karma/reporter.ts:59:49)
at step (/Users/erikbarke/Development/npm/monounity/karma-typescript/examples/angular2/node_modules/karma-typescript/dist/karma/reporter.js:33:23)
at Object.next (/Users/erikbarke/Development/npm/monounity/karma-typescript/examples/angular2/node_modules/karma-typescript/dist/karma/reporter.js:14:53)
at fulfilled (/Users/erikbarke/Development/npm/monounity/karma-typescript/examples/angular2/node_modules/karma-typescript/dist/karma/reporter.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
errno: -21,
syscall: 'open',
code: 'EISDIR',
path: '/Users/erikbarke/Development/npm/monounity/karma-typescript/examples/angular2/coverage/chrome/karma'
} Since this was caused by a bug in an earlier beta version I'm not sure there's anything to fix here, the istanbul reporter is already throwing an error about an "illegal operation on a directory", and having a coverage reporter deleting sub directories is probably a bad thing 🤔 On the other hand, I haven't been able to reproduce your error, @christophercr, what are the steps, do you have an example repo? |
@erikbarke I did more troubleshooting and now I know why I get the error. It is because I run the tests via my IDE (IntelliJ - WebStorm) and for some reason, the execution reaches this line: https://github.com/karma-runner/karma/blob/a673aa8ad76f733565498f2aab13fcd720502be1/lib/reporters/multi.js#L11. However, if I run the tests in a terminal, they work just fine as that line of code is never reached. Do you think you could add an You could define the |
@christophercr, yes, this is probably a good idea and it seems the best way to add these kinds of properties is by using the |
@christophercr, does the fix in #368 work for you? |
Yes, that does the trick! Then it works like a charm on Webstorm! Thanks for the fix 😉 |
Use correct 'this' for base reporter, fixes #367
my unit tests worked fine with 4.x, and it also worked fine with 5.0 beta-1
but when switching to 5.0 release or 5.0 beta-3, it always show this error after all the tests are passed.
any idea how I can trouble shoot this?
The text was updated successfully, but these errors were encountered: