saikat / react-apollo-starter-kit

A production-ready starter kit for making a React/Apollo application.
MIT License
186 stars 28 forks source link

nodemon doesn't play well with node-foreman? #18

Open jmcclell opened 7 years ago

jmcclell commented 7 years ago

Running this setup straight from git on Ubuntu 16.0.4

$npm run dev

Everything works, but nodemon doesn't detect filechanges and doesn't restart. It also seems like things don't shut down correctly with ctrl-c as the exit logging is always "Application exited abnormally"

Any ideas on how I might debug or are there any known issues here I'm unaware of?

saikat commented 7 years ago

Hm, I can't reproduce this on Darwin but my guess is this has something to do with fsevents not working properly on Linux. Maybe related to #14. I'll try to reproduce this in a couple weeks, but any chance you could dig into what is a good replacement for fsevents (or a way to make nodemon work) on Linux?

jmcclell commented 7 years ago

@saikat Ah, I should have commented and closed this. Lack of sleep made me forget that I was running in a Vagrant box while modifying locally. I was testing nodemon by itself locally and it was working, meanwhile running my build dev script on the Vagrant box and thus wrongly concluding it must be node-foreman's fault.

For anyone else interested in that particular issue, I found the following solutions:

In the end I ditched Vagrant for running the node scripts and just keep it for running the supporting services I need that either don't run well on OSX or that I just don't want to install locally. I surmise a similar issue would exist if using Docker, but haven't tested.

As for your question, @saikat, for Linux you may be able to use inotify instead? Can't say I've looked into it personally.