Web Essentials v2.8 LESS import error - visual-studio-2012

For better organization, I have a main .less file that imports other .less files using the #import syntax. In order for the Web Essentials Preview window to work I also have #import-once at the top of each .less file that imports the variables.less file.
This solution worked wonderfully until I upgraded to Web Essentials 2.8. Now I'm unable to import any .less file that has #import or #import-once declared in it. My main .less file no longer compiles.
If I remove the #import-once statements, the preview window is useless since I can't see the compiled CSS without importing my variables file.
I also had a case where I imported a .less file into a ruleset, as defined by lesscss.org in the Importing into ruleset section. This also no longer works since the upgrade to v2.8.
Has anyone else experienced these issues or have a resolution?
Thanks

This seems to be a bug -> Feature in the latest version of the WebEssentials because of a new feature in Less 1.4.0. as Anwar describes. See the changelog of Less:
1.4.0 Beta 1 & 2 (2013-03-07)
default behaviour of import is to import each file once. #import-once has been removed.
Either
Update your files to use the new syntax (remove the -once from your imports)
Or
To use the older version of the engine, download the previous (2.7) version and don't update until you know it has been fixed.
Or
Or you can configure your Visual Studio to look at the Nightly Build feed from Web Essentials to download the very latest version (caution, nightly builds may contain other bugs or stop working from time to time). TO do so go to Tools -> Options -> Extensions & Updates and add the feed: http://vswebessentials.com/nightly/feed.ashx
Which seems to add a workaround that makes it work with the old syntax as well.

In Less v1.4.0 #import-once has been removed and #import imports once by default. This means that with the following
#import “file.less”; #import “file.less”;
The second file is ignored.
I think that one is causing issue with import statements.

Related

Cannot resolve symbol 'ImmutableList' in Android studio

I try to implement Google Play Pay but don`t know how solve this problem:Type of ImmutableList cannot be resoclved.
Should I import some package?
I have search with Google and no any question like this(Android studio)
ImmutableList.of(QueryProductDetailsParams.Product.newBuilder()
.setProductId("product_id_example")
.setProductType(BillingClient.ProductType.SUBS)
.build())
Android Studio suggests the firebase-crashlytics-buildtools dependency to import the ImmutableList class. Doing so resulted in a big increase of the file (bundle) size.
Try instead including guava as a dependency, if you are not using crashlythics in your app:
// graddle
implementation 'com.google.guava:guava:31.1-android'
// java class/code
import com.google.common.collect.ImmutableList;
This has a much smaller impact on the file size. In my case, the bundle was 2MB compared to 10 MB if using crashlythics-buildtools.
I run into the same problem. By hovering with the pointer over 'ImmutableList' I selected the entry Add dependency on com.google.firebase:firebase-crashlitics-builtools and import...
This action created the following line in the import section of my activity file
import com.google.firebase.crashlytics.buildtools.reloc.com.google.common.collect.ImmutableList;
and the following line in the build.gradle file:
implementation 'com.google.firebase:firebase-crashlytics-buildtools:2.7.1'
However, the word reloc in the import line initially appeared in red color with the hint Cannot resolve symbol 'reloc'. Then I noticed that in the build.gradle file, android studio was offering to change the version of the crashlytics-buildtools from 2.7.1 to 2.9.1. After doing so and syncing gradle, the word reloc was no longer red and ImmutableList was recognized correctly.
I wonder whether it is really necessary to import the firebase crashlytics-buildtools for the integration of the Google Billing Library (I use it for an app with in-app purchases) or if there is a more simple way to do this.

Typedoc: document only things exported by a specific file

I am developing two npn packages:
https://github.com/euberdeveloper/mongo-scanner
https://github.com/euberdeveloper/mongo-cleaner
I want to document them by using typedoc. The index.js file is the one provided by the npm module and is obtained by index.ts.
I want to document only what is exported by the library index.ts. I can filter the non-exported things with the typedoc options.
The problem is that the index.ts import things from other TS files and export only some of them. For instance, it imports and re-exports some interfaces from the interfaces/index.ts and the errors classes from errors/index.ts, but imports without exporting the class Database from the utils/database/index.ts.
Being actually exported, things such that Database class are documented even if they are exported by a file different from index.ts.
How can I filter them?
The current #next version of typedoc has a --library mode. Seems that there are going to be big changes with the #beta version and the future 1.0.0 version, where the mode option will even disappear. Development seems to proceed extremely slow, so I think that the only way now is to use the (probably bugged) #next and #beta versions and wait.
Edit: the 0.20.x is no more beta and has been released, it works good, so the problem is solved

Can't compile nested less files with Web Compiler 2015

well, I was quite surprised when installing Web Essentials 2015 for Visual Studio 2015 that it didn't include a less compiler anymore:
"Web Essentials 2015 no longer contains features for bundling and minifying of JS, CSS and HTML files as well as compiling LESS".
Everything worked fine before with Visual Studio 2013. So I downloaded Web Compiler 2015, as it is the new compiler from Mads Kristensen. But, after adding all the needed files to be compiled to the compilerconfig.json, I have an error on compilation that it doesn't recognize my variables anymore nor my mixins!
Here's my site.less:
/* Colors and common variables */
#import "Colors";
#import "Variables";
/* Reseting default values for all internet browsers */
#import "Reset.css";
/* BootStrap */
#import "../../../Content/bootstrap/bootstrap.less";
/* Basic mixins */
#import "mixins/Generic_Mixin.less";
#import "mixins/Controls.less";
#import "mixins/Images.less";
#import "mixins/Navigation.less";
#import "mixins/Text.less";
/* Website specific classes */
#import "Controls.less";
#import "Footer.less";
#import "Header.less";
#import "Images.less";
#import "Text.less";
#import "combobox.less";
#import "Sitemaster.less";
And here's one of my many errors :
variable #font-size-base is undefined on line 49 in file
'C:\Users\(...)\Site.WebApp\App_Themes\Default\Styles\mixins\Variables.less':
Please, I don't understand anything to all of this, anyone would have an answer for me ? Thx.
I had the same problem. Web Compiler failed in many ways and the workarounds were messy and wouldn't have been easy to support. Future versions of Web Compiler might be useful, but I came to the conclusion that it's worth the trouble to just switch to a more mature less compiling tool.
This is what worked for me:
Disable Web Compiler
Tools->Extensions and Updates->Installed(search for Web Compiler)->Disable
Then setup Grunt.js by following one of the many tutorials out there. I used this one by Scott Hanselman:
http://www.hanselman.com/blog/IntroducingGulpGruntBowerAndNpmSupportForVisualStudio.aspx
Here's another guide I found very useful:
https://www.orderfactory.com/articles/Bootstrap-LESS-Grunt-VS.html
Since it sounds like you were basically where I was before I followed these instructions, there's a chance you might run into another issue with TypeScript compiling, which Web Compiler turned on by default.
If you get a bunch of "duplicate identifier" errors related to lib.core.d.ts, you may have to disable automatic typescript compiling:
right-click Project->Properties->TypeScript Build->uncheck "Compile on save"
Installing Web Compiler and setting up node tools and assigning an automated task can result in unleashing the ts compiler to run through all the node_modules, looking for things to compile. It can be a mess.
If you want to leave TypeScript compiling on build, you'll need to add a tsconfig.json file to the root of your project to define specific file paths. Without this file, the compiler looks everywhere and you really don't want that. I found it easier to just disable it.
Here's more information on that:
Typescript, confusing "duplicate identifier" error message
Hope this helps.

setting up google play expansion file library in android studio

I am trying to use apk expansion files in my android project, I've read this
http://developer.android.com/google/play/expansion-files.html
I tried to follow those steps, but I cannot figure out how to set up / include in my project / google play apk expansion library.
I've been searching for hours, didn't find right answer. Any help?
I just tried to set up the modules listed in http://developer.android.com/google/play/expansion-files.html today, but the play_apk_expansion/downloader_library cannot be imported as supplied.
The issue is a stale library reference in play_apk_expansion/downloader_library/project.properties
Update the last line from:
android.library.reference.1=../market_licensing
to:
android.library.reference.1=../../play_licensing/library
Note the extra ../
Then use File -> New -> Import Module... to import the play_apk_expansion/downloader_library as usual. It will also import the play_licensing/library as library but that can be renamed to something more useful afterwards.
I have not found a better way than importing via eclipse, so I have set up a github repo where this has already been done:
https://github.com/coltsoftware/ExpansionAPKsAndroidStudio
Copy sdk/extras/google/play_licening/library to Eclipse workspace
Copy sdk/extras/google/play_apk_expansion/downloader_library to Eclipse workspace
Eclipse: New --> Android project from sources to create two library projects from the above copied files. Don't forget to make the correct library reference to play_licening for downloader_library.
Android Studio: New --> Import Module, and import play_licening first, and then downloader_library.
To use Andrew's answer with Android Studio 2.1, I needed to update:
market_apk_expansion/downloader_library/project.properties
to
android.library.reference.1=../../market_licensing/library
before I could import the module as described.

Typescript giving "Output Generation Failed" in Visual Studio 2012 with 0.9.5

I've been using Typescript 0.9.5 for the last few days, and then suddenly today the JavaScript files just stopped being generated. I see an error "Output generation failed" in the Visual Studio status bar, but nothing in any of the output windows.
I've rebooted, and restarted Visual Studio, disabled Web Essentials, tried all the usual things.
The files are set as TypescriptCompile in the properties. I've tried adding new files, or editing old ones with no effect. The Project file hasn't been changed as far as I can tell (its in TFS and none of the TypeScript sections have been altered).
I've made sure both files are checked out, still nothing.
Update: I've managed to compile manually using tsc.exe from the command line, so it must be something in Visual Studio.
OK, so I solved the problem.
One of my files contained invalid typescript, specifically trying to export a class when not inside a module. This caused all typescript files to fail to generate, but with no useful error message.
The following file would cause the problem:
export class Test {
public DoSomething() {
}
}
Either removing the export keyword, or adding a wrapping module solved the problem.
I've raised it as an issue here: https://typescript.codeplex.com/workitem/2109
Update: More details.
The above syntax is valid if you are using the CommonJS or AMD module patterns.
To enable this in visual studio you need to edit the .csproj file and insert a new PropertyGroup:
<TypeScriptModuleKind>AMD</TypeScriptModuleKind>
If you have an export outside of an internal module Typescript tries to compile it as either commonjs or amd module format. The compilation will fail if the a --module flag is not present on the command line. Use your project properties to set it to the desired value (probably amd in your case).
More info on TypeScript modules : http://www.youtube.com/watch?v=KDrWLMUY0R0&hd=1

Resources