-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Grunt watch - doesn't see file changes #1619
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
Comments
It does not work for me too. I tried on Linux and Windows. |
Ok - a little more information. Grunt watch does pick up changes i make to files in However this file is not a symlink (I believe it is intended to be) rather is is a copy of the theme's file. So I think the problem is that |
Same in #1590 @davefarthing, @bgkavinga |
Great Thanks! Just to clear things up a little: should grunt watch work with server-side compilation? I've tried both but didn't like the client-side compilation, I was under the impression grunt was a solution offering auto refresh from server-side compilation (!?). My current settings are to have server-side compilation and grunt exec/watch. (if that helps bottom out the problem) |
@davefarthing yea, mine too. Client side compilation is more another feature that can be used for quick changes, when developer not familiar with Grunt or not have node.js or don't want each time manually delete |
Should be fixed. Please update to the latest version |
Hi, I have pulled that latest master, but the problem still exists. I can see that the source less file are now under 'var/view_processed/source' rather than 'pub' but they are still copies of the original modules' less files rather than symlinks. Same symptoms: 'grunt watch' doesn't see any changes to the theme files 'grunt less:luma' doesn't see any changes either. If I 'grunt clean:luma' first then 'grunt less:luma' it will show my changes. Seems again the only missing piece is file copies as opposed to symlinks. |
@davefarthing All fixes are delivered to |
@davefarthing latest default |
@godban we're having the same issues on the master branch as written here. But however we try to switch to or merge the develop branch into the master, we can't get our current 1.0.0 beta (with sample data) to work with the develop files. Grunt install fails too by the way, on the step "npg instal". Something to do with phantomjs. We're currently deleting both the preprocessed files & the pub/static files (although preprocessed files cache is disabled). Only when both of these dirs are empty, and we reload the pages, everything is fine (although sometimes on 2nd load, which is a known issue because of slowness). It looks like the pub/static files are created from the preprocessed files in the var directory, so deleting both of these is the only way we can see our css/less updates. We're in the process of creating our own base theme, extending the blank theme, but are running into these less issues & some others we're hoping to be fixed in one of the thousand commits the develop branch is ahead of the master. Thx. |
@debuysserk here is a patch https://gist.github.com/godban/8cb178f9a84ed85f1eac |
thx @godban . I got it working but still some weird stuff : When the pub/static & preprocessed files are empty, and I load the pages. Those directories are filled.
When updating the less files in my theme, grunt watch does not pick things up. BUT, when I use the magento bin command on my theme to deploy the styles-l & styles-m than this creates .less aliases in the pub/static dir. And then, when I edit my source less files in the theme again, grunt watch DOES pick my changes up and compiles them instantly, without having to use the deploy command again. Is this expected behaviour? Thx! |
From what I see the grunt watch command picks up css files ? I don't see why it should be watching the css files. From what I see it should be watching the changes on the less files to generate new css files. |
@vasuscoin from what I see you have grunt installed globally. Following steps must be completed before grunt {exec,watch,...} will work: $ npm install grunt --save-dev
$ npm install If you are working on a custom theme you probably will have to update before you run then you can run grunt with any of its tasks. for additional info, see the devdocs: http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/css-topics/css_debug.html |
@BlackIkeEagle Is any solution please ? |
@vasuscoin Could you test it in a vagrant (linux) machine. Maybe its just an issue with windows. If so I cannot really assist you since I have no access to a windows machine. You can use https://github.com/alankent/vagrant-magento2-apache-base for quick testing. |
@BlackIkeEagle i tried to run everything you mantioned above, but unsuccessful |
@dav1dian I think it will not work on windows since the feature relies on symlinks to work |
@BlackIkeEagle |
@dav1dian oh i did not know windows supports symlinks. sorry can't help you further |
@BlackIkeEagle |
This issue has been resolved. Do let us know if you encounter any other issues by submitting a new issue. |
I've got the same issue! The Problem is as follows: I have two less files in my What am I doing wrong? |
@Snohe In which commit / version was it resolved? Still seem to have the issue in Magento 2.1.0 |
I am setting up a magento 2.1 and the problem seems to still be there. Any idea on how to solve the problem? |
@Tyrianad see @markdavies comment above. I just gave up and used 1.9 for my project, hope things are better in 2.2. |
@anpel Well... great.... i did know Magento 2 had some problems but couldn't imagine this big. |
After some more research i managed to fix the watch problem. The problem was caused by the |
I can confirm previous statement of @Tyrianad, changing " to ' in |
I got it working by running these commands once before running
After that watch works as expected. |
@dakira cheers that solved my issues with sourcemaps not showing up too |
Public Pull Requests #11678 [BACKPORT 2.1] [TASK] Moved Customer Groups Menu Item from Other sett… by @lewisvoncken
That issue is marked as closed, but it still occurs. only with the solution of @Tyrianad it work - but is this the correct solution? If you create following structure: (and not note the infos of @Tyrianad)
The includes are made without @Tyrianad solution. Maybe this bug is a similar problem ... |
@Fredwak my solution works perfectly fine for me (and many others I know). I think this problem is a documentation problem on the Magento side. After more playing around (and using multiple themes) I settled on doing this once for every new theme before running
This should be part of the documentation on how to create a new theme.
|
oh sorry - i have missed to add the text "(and not note the infos of @Tyrianad)" |
For some reason symlinking does not work when you start the file with When I comment out the below lines the symlinks are created and grunt watch works.
|
This is still an issue. I'm on Edit: I can confirm that taking out the I can also confirm that changing the quotation marks from double to single, and appending the Additionally, I can confirm with absolute certainty that the Magento2 frontend is a fickle, over-engineered, and such a poorly designed POS that it's effectively the eighth wonder of the world in my opinion. It belongs in Reddit's /r/DiWHY/, too. It really feels like Magento2 developers took every trendy blog post on design from the last decade and stitched them together into some gross Franken-fetish RealDoll. I feel like I need a degree in WTF to change the color of an anchor tag. Explaining Magento2's frontend is like Bob Newhart's comedy skit about tobacco. |
Hello, I am also having this problem.
followed by
However this doesn't seem the way it should be. I have been following the Magento guide, so I have no special configuration or anything. |
This is my workaround for this problem. Go to your terminal
then open package.json in the magento root, and add this bit
replace of course what's in capital letters with your folder names. then from the terminal:
Now it will watch for changes and run the clean and less tasks when a change happens. Ugly workaround I know. |
This comment was marked as abuse.
This comment was marked as abuse.
@iget-master To me your solutions is not working though :( |
Are you on linux? Can you post a the result of |
This comment was marked as abuse.
This comment was marked as abuse.
@iget-master sorry I omitted that I started all this because grunt watch does nothing :) |
@iget-esoares I only have a print.css... |
for me, this solves the problem, Thanks |
If anyone comes here because one or more *.less files are copies instead of symlinks and grunt watch doesn't watch these files: |
Making sure that imports had .less worked for me as well. |
Oh Magento, can't even build css properly 😂 it just decides to stop watching sometimes... And takes ages when it does. 😬🔫 |
For me it was slightly simpler than #1619 (comment) All i needed was to make sure the |
[QUESTION]
I have node installed and have run 'npm install' but when trying to use grunt watch doesn't pick up on any of the changes i'm making.
I can successfully run 'grunt refresh' to recompile but watch does nothing.
it runs without error or warning and sites at a prompt:
Running "watch" task Waiting...
If i then make a change in the less files e.g.
app/design/frontend/Magento/luma/Magento_LayeredNavigation/web/css/source/_module.less
(simply trying to change option title color)No change is recognised and no recompile occurs. I'm running under OS X if that has any influence.
What am I missing (or not understanding)?
ALSO:
according to http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/css-topics/css_debug.html
"grunt exec:
Republishes symlinks to the source files to the
pub/static/frontend/<Vendor>/<theme>/<locale> directory
."All of my files are in pub/static/frontend/.. as copies not as symlinks (is this wrong)
The text was updated successfully, but these errors were encountered: