Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Grunt watch not working with Brackets #9884

Closed
edge0703 opened this issue Nov 9, 2014 · 9 comments
Closed

Grunt watch not working with Brackets #9884

edge0703 opened this issue Nov 9, 2014 · 9 comments

Comments

@edge0703
Copy link

edge0703 commented Nov 9, 2014

Does anybody know why Grunt watch isn't working when I save a file inside of Brackets? It seems as if the files don't get changed at all.

Does it have to do with Live Preview?

For example: I open _main.scss in Sublime Text 3, I save it there, grunt watch recognizes the change and compiles the file.

If I open the scss file in Brackets and save it, nothing happens in the command line with grunt watch. Also doesn't work with JS or PHP files.

@jasonsanjose
Copy link
Member

Mac, Windows or Linux? Live preview shouldn't make a difference. I wonder if file watching in Brackets is causing any issues.

What version of node and grunt are you using?

@edge0703
Copy link
Author

edge0703 commented Nov 9, 2014

Sorry for the missing information.

I am on a MacBook Pro with Yosemite. Grunt is "~0.4.1", watch is "^0.6.1" and node is on "v0.10.31".

@edge0703
Copy link
Author

Just tried it on another computer at my job, also doesn't work there. What a pity. :( I'd really love to use Brackets, but if it doesn't work with Grunt watch, it's rather useless for me (and probably others). Live Preview is no substitute, because it doesn't work with Sass yet.

@edge0703
Copy link
Author

Just tried it with Grunt BrowserSync and there it works.

@peterflynn
Copy link
Member

@edge0703 Hmm, other people definitely have successfully used Grunt watchers in conjunction with Brackets. It's hard to imagine how Brackets could be at fault here, since all we do is use the regular OS APIs to write to the file. Some questions, though:

  • What version of Brackets are you using? If not 1.0, could you try updating and let us know if it's still happening?
  • Does it still happen if you select Debug > Reload Without Extensions to temporarily disable all extensions?
  • Are your changes actually being saved to disk? (E.g. if you open the file in another editor, or quit & reopen Brackets, are the chances still there?). Has the timestamp of the file updated to reflect when you last saved, or is the timestamp older?
  • Are you editing files on a network drive, or within a symlink path?
  • Are you editing the same exact files in the same exact location when you're comparing Brackets to other editors? (You can verify the full location of the file open in Brackets by right-clicking and choosing Show in Finder).
  • It might be worth searching the Grunt repos on GitHub to see if any Grunt bugs match up with what you're doing. E.g. there are issues like this and this which could be at play.

@MiguelCastillo
Copy link
Contributor

I use grunt-contrib-watch everyday, no problem.

@peterflynn
Copy link
Member

@edge0703 Two other questions:

  1. Are you launching Grunt before or after launching Brackets? Does the behavior change if you reverse that order?

  2. Another thing you could do is log the Mas OS change events that occur:

  1. Open Brackets and open the '_main.scss' file
  2. Open Terminal and run sudo fs_usage -w -f filesys | grep "_main.scss"
  3. Save the file in Brackets
  4. Copy everything that was printed to the Terminal, and paste it here

@edge0703
Copy link
Author

Actually it works now, don't know what the problem was. Did everything the same as last time, but when I opened Brackets it suddenly works now. However thanks for all of your help.

@ingorichter
Copy link
Contributor

@edge0703 I assume you are working on OSX. Do you recall the full path to your project folder? I'm just curious, because I found some issue with the way we decided if a path is local or remote. In the case that the path is considered remote, no file watching would be turned on. Could be totally unrelated, but I'm just curious. :-)
I'm closing this issue for now, since it has been resolved for you in the meantime.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants