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

Watching is not working properly on linux #1113

Closed
ertwroc opened this issue Jun 26, 2014 · 8 comments · Fixed by #1114
Closed

Watching is not working properly on linux #1113

ertwroc opened this issue Jun 26, 2014 · 8 comments · Fixed by #1114

Comments

@ertwroc
Copy link
Contributor

ertwroc commented Jun 26, 2014

Watching functionality is not working properly on linux. After initial execution of test Karma is only watching one change in file and stop watching it.

@abierbaum
Copy link

@ertwroc This is hitting me as well. I know this has worked correctly in the past.

@abierbaum
Copy link

I just created a test project to test this bug and I have not found any release in the 0.12.x series that works. I also tried the latest 0.12.16 release with some older versions of chokidar (0.7.1, 0.8.0) and that doesn't work either. I am going to back off and use your workaround from #1114 to just use polling. This works but does seem less than optimal.

@vojtajina Looking through the commit history it looks like you were using Linux and non-polling detection with no issues late last year. Any hints at what we could try next?

@patotoma
Copy link

The problem is still presented in 0.12.19.

@siler
Copy link

siler commented Jul 28, 2014

I am having a related problem with chokidar 0.8.2 in 0.12.19. When using watchify, the karma server appears to serve up and cache the resultant .js file before it is fully written to disk (?). I keep getting errors like these:

INFO [watcher]: Changed file "/home/siler/code/journeyList/build/js/app.js".
Chrome 36.0.1985 (Linux) ERROR
  Uncaught SyntaxError: Unexpected end of input
  at /home/siler/code/journeyList/build/js/app.js

If I navigate to the debug screen and view the source of app.js the contents are abruptly cut off at a seemingly random location.

I can split this one off, but it seems related in that switching to polling via #1114 works just fine.

@hsablonniere
Copy link

Same problem here :-(

node: 0.10.29
npm: 1.4.21
karma: 0.12.17
karma-cli: 0.0.4

Linux #### 3.11.0-26-generic #45~precise1-Ubuntu SMP Tue Jul 15 04:02:35 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

The fix in #1114 works for me.

@vojtajina
Copy link
Contributor

This is a sad story. Somebody should invent OS where these events work.
I'm merging #1114 to revert back to polling.

Btw. you can do it yourself in the config: config.usePolling: true.

@bcherny
Copy link

bcherny commented Jul 26, 2016

If anyone runs into this in the future, what worked for me was adding the following line to karma.conf.js:

transports: ['polling']

@henrythach
Copy link

Another suggestion for those reading this in the future, what worked for me was increasing the amount of inotify watchers.

Check out this Increasing the amount of inotify watchers to learn about the details, but here's a snippet if you want to try it out:

  • If you are running Debian, RedHat, or another similar Linux distribution, run the following in a terminal:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/> sysctl.conf && sudo sysctl -p
  • If you are running ArchLinux, run the following command instead (see here for why):
echo fs.inotify.max_user_watches=524288 | sudo tee /etc/> sysctl.d/40-max-user-watches.conf && sudo sysctl --system

Hope this helps.

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

Successfully merging a pull request may close this issue.

8 participants