Pug/Jade watcher not recompiling pug files

I had been using Pug/Jade watcher fine for months, then all of a sudden it stopped watching and recompiling pug files instantly. I had to restart the server to see changes. So I tried deleting the old pug watcher, re-installed pug and pug-cli -g and created a new watcher. The Program binary is at "/Users/ted/.nvm/versions/node/v6.11.1/bin/pug" which is version 2.0.0-rc4 (the latest). When I modify a pug file, I see the recompile bar activity below briefly, but the server isn't serving the updated file content. I have to restart the server to see changes.

8 comments

You index.js is not an executable file, it's a JavaScript file that can only be run by Node.js.

To be able to run Pug in command line (and use it as a file watcher), you need installing pug-cli (https://github.com/pugjs/pug-cli) globally:

npm install pug-cli -g

and then specify a full path to pug executable (usually /usr/local/bin/pug  - run which pug in terminal to check the path to executable) as a Program in your file watcher

 

>What is error "13"? 

 

It's "Permission denied" - see http://www-numi.fnal.gov/offline_software/srt_public_context/WebDocs/Errors/unix_system_errors.html. The error occurs because you are trying to run a file that doesn't have executable permissions

0

You were too quick. I was editing while you replied. Please see above. Still not working. Thanks.

0

>When I modify a pug file, I see the recompile bar activity below briefly, but the server isn't serving the updated file content. I have to restart the server to see changes.

 

So the file is successfully compiled, but you server doesn't see the updated content? Do you use WebStorm deployment to upload files to server, or files are served from your project directory, so no uploading is needed? What does you watcher look like? Please attach a screenshot (make sure that all fields are fully visible)

0

I'm not using WS deployment, just running local server from my Mac and browsing at localhost:3000. Screenshot:

 

0

Everything looks OK. Doesn't look like file watcher issue then. What does your server look like? Just a Node.js Express server serving files frpm your local project dir? Why do you expect it to serve a modified content without restart?

0

Yes, local Node Express. Because it has served updated file content without restarting for 6+ months. 

0

well, I can't see how this can be related to the IDE/file watchers. The watcher definitely works - as you can see changes after server restart. And normally Express server restart is needed to see the changes - unless you use tools like nodemon or superviser that watch files for changes and restart the server for you

0

Thank you so much. Apparently, this is user error. I didn't notice pug was generating errors in the console which prevented updating all of the views. Problem solved. Very sorry.

0

Please sign in to leave a comment.