-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Changing an imported file does not cause a re-compile (cache issue ?) #47
Comments
Yea, something I have to look into. |
I made a change in 1.0.30, which refreshes the cache on page load only in development mode. It should work as a temporary fix for now. |
That would work great when Do you consider pulling my commit ? This would:
The condition could become something like |
Hi Alexis, I'm also having some problems related to this issue. It seems that the changes in nested imports don't get recognized right away. Even though I ruined the imported less file, the changes seem to be ignored(using the cache perhaps?). I just wonder how you cache the compiled less. I don't see it in cookies, and my browser's cache is disabled. BTW, I found this issue when working on Dominik's Flawless. Check the issue here: Thanks! |
Whew, thought I was losing my marbles there for a second. Glad I found this ticket to confirm that I'm not totally insane. |
yes, I second this, or 5th it, whatever. Been driving me mad trying to have a random value in an included file. Also, just changing the included file, I have to re-save all of the files which import it to see the changes. |
why not rely on the server's Cache-Control Header along with ETags checks? |
+1 I was tearing my hair out too! |
This issue made me stop using js to compile in development env and started using the Less App. But my windows mates are f****. I gotta check @vicb commit or fork to try a sollution. |
I came here to report this issue too. I appreciate your work. |
yeah, this issue is nearly show-stopper when working with multiple files |
It can be solved with a little trick: before calling less.js file, insert a script with:
This will force cache reload. @cloudhead why not document this and close this issue? |
@leobalter I've just been using less.env = 'development'; is the first part required? |
it's only a fail safe, as I'm proposing to set it before loading less.js, you can get a 'less is not defined' error without setting it as an object. |
@ahmadnassri without |
For the sake of being as terse as possible
or if you're worried about clobbering an existing instance of the less variable
|
@leobalter @neonstalwart true, it would be a general problem, I forgot that I have a custom implementation, I add the environment variable AFTER I include the library and I only trigger less manually through JS actions (I'm doing complex History management and front-end page-reloads) I do like @ttfkam's method though as its fool-proof! |
Hmm I'm getting the issue on a remote server as well even when I have changed the host name from localhost to my domain in the less.js file. It works just fine locally though with the imported style sheets. |
Commenting to watch. Ignore. |
@adityavm there is a link under the comments where you can turn on/off notifications. once i've posted this i'll be using that link to turn off notifications for this issue :) |
https://gist.github.com/1346280 is my current solution to this problem. |
This happens to me also in 1.1.5. The script uses localStorage to store the stylesheets. Clearing your browser cache won't work. You must clear it's cookies (logging off all your accounts, %!@^#%) or doing localStorage.clear(). I use this before loading less.js (not using localStorage myself):
When going to production you just compile the stylesheets to .css |
#72 was marked as a duplicate of this issue, but the above issue doesn't appear to address the less.watch() aspect of the problem, as far as i can tell. Is there a way to get less.watch to recompile when an imported file is changed? |
This issue is still present in latest version of |
+1 This essentially renders watching useless, since any decently sized project will use @imports |
Having just split out our less into separate files due to unwieldy length, I now regret it.. any news on watch refreshing imported files? Loving less though. Thanks |
haven't seen a pull request for it so it is unlikely to be very soon. |
As said before, it works if you just do "less.env = 'development';" before calling less.watch() |
This breaks other things. |
Hi! |
holy hell this drove me nuts. |
Does not fix watching @imported files for me. |
+1 on watch() being useless without watching import'd files :( |
Wow it's been 2 years since this bug is out and nothing has come out of this? Most of the work around still needs you to refresh the pages, which defeat the purpose of watch on the first place.. +1 for me too, everything in less is @import for me, so if I can't watch this the live watch mode is kind of useless. |
Also +1. Such a huge bug shouldn't wait 2 years to be resolved. |
If you help debug the issue and find the exact problem or come up with a way of solving it, it will be fixed much quicker :) Welcome to open source - less.js is not supported by any companies or paid employees. |
Your condescending comment doesn't help either - I am just starting to use less.js and this bug seems to be a major concept flaw, or at least a flaw at the heart of what I wanted to use less for - |
but maybe someone will read my comment and help fix this. Its pretty demoralising to spend 6 days of your personall time fixing things for other people and then read comment after comment criticising that one particular bug or feature has not been looked at. It reads as criticising the people who do actually do things. All I'm saying is that if you like less and find a bug you don't like - help out a bit and everyone will be happy. |
Is there a technical reason for why the client-side less.watch() functionality is not import aware? Expected behaviour: a client-side recompile process is triggered when the main less file or other less files imported by the main file are modified. Current behaviour: recompile process is only triggered for main less file, imports are not being watched. |
@agatronic Welcome to open source development, aka: Ego Driven Development (EDD). You can't expect everyone to help since not everyone can afford the time or has the technical expertise; This is a CSS pre-processor that many web DESIGNERS, not developers, are using, after all. Likewise, you can't expect users to be sympathetic just because this is open source. The harsh reality is, normal users need things to work and they don't care if it's proprietary or open source, so the best thing to do is take the criticism in stride. They're giving you the same feedback they'd give anyone else, paid or otherwise. Accept the criticism as constructive or your ego will be bruised and you'll give up; Why do you think so many open source projects are abandoned? |
I just found this pull request which solves the issue; #776 |
This still seems to be an issue in the version in the CDN linked to from the front page. |
5 years later, still an issue. grumble |
It is still not fixed. |
Any movement on this? First time I've used less (coming from stylus and scss) and running into this problem. |
Regarding recent comments: this is something that was addressed and fixed. If there is a new issue (or a reversion), this should be opened as a separate issue that explains the problem. That is, in "development mode", and assuming you are compiling in the browser, it should not cache the files and compile every time. Otherwise, it will only refresh the files if the main |
For correct behaviour, it needs to refresh the files if any |
Workaround hack for browser caching: In function Has not been tested with external urls, images and urls with |
Version 1.0.22.min.js in firefox 3.6.3 on ubuntu 10.04
If the html links to a master.less file which @imports a slave.less:
Probably some kind of cache issue ? (clearing ff cache does not help)
The text was updated successfully, but these errors were encountered: