Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is probably a newbie question but I get this error after install and setup less.
LESS error: load error: failed to find sites/all/themes/fresh_theme/css/less.less, sites/all/themes/fresh_theme/css/less.less
I'm not using omega ore some different engine, just drupal core.
I installed the module and added libraries. created a new file called less.less in fresh_theme/css folder, I added the stylesheets[all][] = example.css.less
in .info
What am I doing wrong? Do I have to use Omega to use less properly?
Comment | File | Size | Author |
---|---|---|---|
#25 | fixing_less_load_error-2214125-25.patch | 536 bytes | gmaltoni |
| |||
#23 | less-less-load-error-2214125-22.patch | 924 bytes | argiope |
Comments
Comment #1
corey.aufang CreditAttribution: corey.aufang commentedOmega is not required at all to use the LESS module.
It looks like you have a path issue.
I used the less_demo module that is included with the LESS module to test and confirm the issue.
I was able to duplicate this by changing the relative path to the location of the .less file in the .info file.
stylesheets[all][] = styles/less_demo.info.css.less
to
stylesheets[all][] = less_demo.info.css.less
This cause the error as follows:
LESS error: load error: failed to find sites/all/modules/less/less_demo/less_demo.info.css.less, sites/all/modules/less/less_demo/less_demo.info.css.less
Check to make sure that the path you have to the .less file in the .info file is relative to the root of the module/theme, which is the same folder as the .info file.
Check out the less_demo module included with the LESS module to see the correct way of referencing style sheets.
One more thing that you need to consider: When you make changes to the .info file, Drupal is not automatically aware of the changes and needs to be prompted to look again.
Follow this link for an explanation of what is required for the content of the .info file to be re-read: https://drupal.org/node/337176
Comment #2
RgnYLDZ CreditAttribution: RgnYLDZ commentedThanks for your answer. It was a path issue like u said. I renamed and reordered my folders. Everything works fine now.
Comment #3
corey.aufang CreditAttribution: corey.aufang commentedComment #4
Countzero CreditAttribution: Countzero commentedSorry to re-open, but I have the exact same problem, with a Bootstrap installation.
I created a subtheme and placed the files like this :
and in the .info :
stylesheets[all][] = less/style.less
It seems OK to me (and in fact is in other subthemes on other sites). Everything seems to work OK, but now and then I get the error message :
It's not on every page and I have a hard time telling what are the conditions which trigger the message.
Any idea ?
Comment #5
RgnYLDZ CreditAttribution: RgnYLDZ commentedIf you're sure that your path is right, do a Flush less files in admin/config/development/less.
Maby it will help.
If not check via firebug/chrome dev tools(F12) for errors. That can give you a hint about the problem.
Comment #6
Countzero CreditAttribution: Countzero commentedDid the flush several times to no avail.
No errors in Firebug (Console or Network tab).
Thanks for your input anyway.
Comment #7
Countzero CreditAttribution: Countzero commentedStill can't find where the problem is, and my deadline is coming. I'd be really pleased to have any hint on this.
Comment #8
corey.aufang CreditAttribution: corey.aufang commentedThe only thing I would try is changing the file extension from '.less' to '.css.less'.
It shouldn't cause any differences, but its possible that there is a error with my handler code.
Wait, you're saying its not on every page?
Clear your browser cache, or disable caching in your browser through the dev tools.
Its possible that the page is being cached, error and all, in your browser so that you continue to see it.
Sometimes I've also had error messages get stuck in the session for the user, so clear your cookies for the domain you're using as well.
If you're still having issues, hit my contact form on my user profile here on drupal.org and I'll see what I can help you with.
Comment #9
malfist CreditAttribution: malfist commentedI've noticed this happens when using wysiwyg and setting it to use "theme css" with less enabled.
Comment #10
Countzero CreditAttribution: Countzero commentedStumbled on this problem on an entirely different project (different server, codebase, etc.).
I think that maybe it comes up when Bootstrap is defined as Admin theme, but the error is so erratic it's very difficult to tell.
Comment #11
malfist CreditAttribution: malfist commentedDiscovered my issue was adding less files with a file ending of css, converting these to less files fixed the issue.
Comment #12
irowboat CreditAttribution: irowboat commented@Countzero did you ever get this resolved?
Seeing this issue also with Bootstrap theme. Some but not all page loads raise an error.
I'm using Bootstrap as admin theme. LESS developer mode on/off doesn't seem to have an effect. The LESS file isn't supposedly found, though the link on the logged error message works.
Comment #13
Countzero CreditAttribution: Countzero commentedNope, never found a solution, and I'm sad to see the latest versions didn't solve this.
It only appears for the admin-ish roles though, if I remember correctly.
Comment #14
gunwald CreditAttribution: gunwald as a volunteer commentedI have the same problem using LESS with bootstrap. The odd thing is, that it does not occur on every page and that everything seems to work well.
LESS error: File `http://www.example.com/sites/all/themes/bootstrap_mysite/less/style.less` not found., http://www.example.com/sites/all/themes/bootstrap_mysite/less/style.less
Flushing cashes does not help and it occurs for admin and normal users. Could not find any hint, where this comes from.
Comment #15
corey.aufang CreditAttribution: corey.aufang commented@gunwald Are you using bootstrap as your Admin Theme?
Comment #16
gunwald CreditAttribution: gunwald as a volunteer commentedNo, I'm not. But I am using it as standard theme. That means, using the admin overlay, sometimes both themes are loaded: Standard admin theme for the admin overlay and bootstrap for the normal pages (behind the admin overlay). So I cant tell which one is causing the errors.
Comment #17
corey.aufang CreditAttribution: corey.aufang commentedWhen the admin is loaded through the overlay, it's actually being loaded in a transparent iframe so there shouldn't be any interference between the two.
Since you're not using bootstrap as an admin theme, it must mean that the problem lies elsewhere.
Are you using 7.x-4.0 of the Less module?
Comment #18
gunwald CreditAttribution: gunwald as a volunteer commentedYes, I am using 7.x-4.0 of the Less module.
Comment #19
argiope CreditAttribution: argiope commentedI'm getting this issue only on pages that have the WYSIWYG editor on them. It looks like some of the stylesheets attaches are not relative to drupal root but have the full url prepended. I ended up adding the if statement after line 36 of the less.wysiwyg.inc file and it cleared it up there is probably more going on there though.
Comment #20
corey.aufang CreditAttribution: corey.aufang commented@argiope It appears that you are using the 7.x-3.x version of the module. Your issue should be resolved in the 7.x-4.0 release.
The related code has been changed to the following, which should remove any URL css path issues:
Comment #21
argiope CreditAttribution: argiope commentedOh oops your right I am.
Comment #22
argiope CreditAttribution: argiope commentedEven in version 4.0 I'm still getting these errors on edit pages.
I have to strip out the $base_url from the path for these to disappear.
Comment #23
argiope CreditAttribution: argiope commentedadding a patch for the dev branch
Comment #24
medhatayar CreditAttribution: medhatayar commentedUpdated less module:
1. Paste less module in module folder (online path: 7.x-4.0 https://www.drupal.org/project/less )
2. Paste libraries in /sites/all/libraries folder. Rename folder name to lessphp so that path will be /sites/all/libraries/lessphp. ( online library path:
https://github.com/oyejorge/less.php#transitioning-from-leafolessphp )
3. Enable module.
4. Flush all cache.
5. If you find error: LESS error: load error: failed to find sites/all/themes/fresh_theme/css/less.less, sites/all/themes/fresh_theme/css/less.less
- Open \sites\all\modules\contrib\less\less_demo\less_demo.info file
- cut stylesheets[all][] = styles/less_demo.info.css.less and paste below less[sheets][] = styles/less_demo.drupal_add_css.css.less
- Flush all cache.
6. click on configurations of LESS CSS Preprocessor (less) module
7. This will take you to /admin/config/development/less
8. Select following less engine
- less.php - http://lessphp.gpeasy.com/
9. Flush all cache
10. Done
Comment #25
gmaltoni CreditAttribution: gmaltoni at CI&T commented@medhatayar,
Your solution solved my less loading problem (module version: 7.x-3.0).
I created a patch for this.
Best regards.
Comment #27
gmaltoni CreditAttribution: gmaltoni at CI&T commentedAnalyzing the build error, I found the following message:
14:40:31 ERROR: No valid tests were specified.
The code didn't cause this problem. The module has already been tested with the patch applied.