-
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
TypeError: Cannot call method 'toString' of undefined in preprocessor.js #524
Comments
Can you debug this a bit ? Edit /Users/name.surname/workspace/cp-agentadmin/node_modules/karma/lib/preprocessor.js and print out the What text editor are you using ? |
This is the error I'm getting:
I'm using ST2. |
@vojtajina @sebarmeli I did more debugging on this and noticed that it's due to the file limit error. Looks like the ulimit for open file descriptors in Mountain Lion is 256 and once we hit that limit, node starts choking with EMFILE errors (ex: sample issue here - nodejs/node-v0.x-archive#2479 / nodejs/node-v0.x-archive#5401 ) I increased my file descriptor limit and the errors do go away. From the discussion in the google-groups I understand node core-team does not want to push a fix into their codebase in the interest of keeping things small.
|
Yep, @kunday is right. I say, increase the limit as a workaround for now, but we need solve this, without increasing the limit. We should make sure we don't hit the limit. It's however little bit more complicated (esp. because of file watching), so I'm creating a specific issue for it: #544 That said, how many files does your project have ? Because I'm on Mountain Lion with 256 as well and I never hit the limit, even with projects like Angular which has tons of files... Can you share your config ? I'm pretty sure you are watching or at least globing a lot of unnecesary files.... |
I see and makes sense to solve this without manually increasing the limit. This is my current config:
(I know that dependencies are managed really bad so we need to have this confusing ordered list of JS files and specs) We've got around 350 source files and 350 specs |
Can you try running it without the coverage ? I think the preprocessor is the main problem issue. |
@vojtajina Yep, that's correct. Coverage preprocessor is the main problem here. |
Hey @vojtajina and @kunday, I'm getting this error now. When I run via commandline with a
I gisted my karma.conf.js. I'm new to node and karma, and was trying to workaround by putting |
What's odd is that if I run this via IntelliJ, I don't get any errors. |
rbarreca: Could it be possible that Intellij updates the ulimit when it runs? |
@kunday yeah seems to make sense. Cool, ulimit was the Google term I was missing. |
@rbarreca I guess you might actually need |
I'd be happy to contribute the fix to this if someone could point me in the right direction... |
Might be totally unrelated, but I'm seeing this error on Linux, where the file limit is set to |
Hey there,
I'm using the below conf (from spec/javascripts)
and a few people in my team are getting this error:
Any clue?
Thanks,
Sebastiano
The text was updated successfully, but these errors were encountered: