Log .less errors to console - asp.net

Each time I have a .less syntax error I have to open the exact less file in browser in order to view the error message.
I was wondering if it is possible to somehow output .less errors to console so I can view all errors directly in the Console log when - for example - using Firebug?
I'm using dotless. I tried setting the webconfig to (by following info this link )
<dotless minifyCss="false" cache="false" web="false" log="error" logger="dotless.Core.Loggers.ConsoleLogger" />
but seems like I'm missing something - not really sure, if I understand the logger correctly.
Also the info about logger on the site states:
Can be set but then gets overidden by the "web" boolean
Does this mean that I must not set the web boolean? How could I make this work?
EDIT AFTER FEW ANSWERS
Ok so I figured out that in order to achieve this result I need to extend dotless.Core.Loggers with my own logger class. Have no idea how to do it but will report back once I get it figured out.

If you're using Visual Studio, you can try using Web Essentials extension, which is free on the gallery. This add-in compiles .LESS on save, and gives you the errors in the output console. You can also see the compiled .css side-by-side as as you edit the .LESS.

It looks like a similar question has already been answered here
In any case, looking at the link you indicated, it makes it clear that you need to set web="true" or miss it out as it seems to be the default.
ConsoleLogger means the Console, not the browser console.
So, you need to set the logger to the one you prefer that works with HTTP (definitely not Console though).

Related

Eclipse - annoying error when editing css files

Each time I edit a css file in Eclipse, I get this error. It really keeps me from doing my work, because it pops up almost after each character.
Can't find resource for bundle java.util.PropertyResourceBundle, key css2.stylesheet-def.description
I would like to disable the parsing for css in order to not get this error anymore, but I didn't find how. Can you give me any tip on how to solve this issue ?
This sounds like Eclipse bug 419986 which says it because of missing translations in the CSS property files.
The bug report suggests deleting the localization plugin (such as org.eclipse.wst.css.core.nl_fr_4.3.0.jar works around the problem).

Trying to override templates in FOSUserBundle, but having no effect

I'm trying to modify the skin of the register.html.twig template found in FOSUserBundle/Resources/views/Registration/register.html.twig.
I've basically followed the instructions in the documentation down to a T.
Like it told to do so, I created /app/Resources/views/FOSUserBundle/views/Registration/register.html.twig.
Cleared the cache (and browser cache just to be sure)
NO effect! I've put a blank file in register.html.twig, but no matter what I put there, when I go to /register/, I still see the default template.
Yep, these things happen all the time.
It should be:
/app/Resources/FOSUserBundle/views/Registration/register.html.twig
Reference

ASP.NET Bundling - Ignoring second JS file

I have set up a simple test using ASP.NET's bundling and minification feature. I have two very simple js files:
~/JS/Site.js
(function echo1() {
alert("this is site.js");
})();
~/JS/test.js
(function echo2(value) {
alert("and this is test.js");
})();
I've created a bundle as follows:
bundles.Add(new ScriptBundle("~/bundles/scripts/site-globals").Include(
"~/JS/Site.js",
"~/JS/test.js"));
and referenced the bundle on the page using #Scripts.Render("~/bundles/scripts/site-globals")
When I run the site under debug (<compilation debug="true" targetFramework="4.5" /> in web.config) I get the expected result - two alert boxes show one after the other.
However, when I run change to release (<compilation debug="false" targetFramework="4.5" />) - I only see the first alert box, and the combined JS file that gets sent to the browser has completely ignored the content of test.js.
The "combined and minified" output is as below, and wrongly only includes the code from Site.js:
(function(){alert("this is site.js")})()
Any ideas on why this is happening would be much appreciated! Thanks
I've found out what was causing this problem. If any of the javascript files have a comment as the last line, they will be combined together without a newline, causing the first line of the next file to be commented out.
Here's a link to another question on stack overflow which demonstrates this: https://stackoverflow.com/a/14223945/11459631
In my case, I was using the Web Essentials Visual Studio plugin to minify my javascript files. It was creating a .js.map file for each JS file, and at the end of each .min.js file was a commented line like this, which turned out to be causing the problem:
//# sourceMappingURL=somefile.min.js.map
Since I didn't need the mapping files, I turned this feature off using Options -> Web Essentials -> Javascript -> Set Generate source maps (.map) to false
Hope this helps anyone who finds this problem!
Matt, your bundling code looks correct, do you receive any js errors in the browser console when running in Release mode? Also as a side note, are you aware that you can simply define the folder path to your JS files and they will all be included?

How does one disable deprecated warnings in Flex 3?

I've recently started working with an application written using Adobe Flex 3. We're using several deprecated functions and unfortunately we can't remove these dependencies.
The documentation says to set -show-deprecated-warnings=false into the Compiler Additional Options. This isn't accepted, but I've found that using -show-deprecation-warnings=false will be accepted by the dialog, but gives an error about declaring the option twice when I try to compile the project.
Ideally, I'd like a way to disable the warning on a case-by-case basis. Failing that, can anyone help me to disable the warnings either per-file, per-project or globally?
As an update for recent versions, I added a compiler option in FlashDevelop:
-show-deprecation-warnings=false
This worked for me.
This link suggests that it doesn't work properly anyway, and the only real answer is to turn off warnings altogether.
Adobe Jira 13569
You can turn off warnings by using a custom flex-config.xml file for each project / globally. Just point the compiler at the right file.
I've found a partial workaround: filter the warnings from the 'Problems' tab. This doesn't get rid of the next-to-the-source warning markers, but it's the Problems tab which I'd like to be clean.
Click the filters button on the Problems tab, change 'Description' to 'doesn't contain' with text 'deprecated' and hit OK.

When debugging an ASP.NET MVC app, how can I get my changes to Site.css to show up?

I'm debugging on my development machine and when I make changes to the css file, they don't show up and I can't figure out why. I'm using firebug and inspecting the css and the changes are not there. I've tried clear private data and building the project first then running it but nothing seems to work.
Thanks.
Use CTL+F5 to force a full refresh -- it will force the browser to ignore anything cached.
It's probably caching your css file. Either modify your setting in the browser to stop caching, or add a unique identifier to the css file like Site.css?d=011509.

Resources