Quantcast
Channel: bundletransformer Issue Tracker Rss Feed
Viewing all 698 articles
Browse latest View live

Commented Unassigned: Less to CSS: ModifyVariables changing across browser sessions [121]

$
0
0
Hello,
We have a very strange problem first noticed in our live multi-tenant environment. Each tenant is able to store a number of theme variables, hex colour codes in a database. The bundle transformer code references a .less file and compiles to CSS with these theme variables (ModifyVariables). We noticed one tenant would randomly see theme colours of another tenant.
Back in development and during debugging we made sure on each Application BeginRequest to invalidate the cache and rebuild the theme CSS on every request. With multiple browsers running against different tenants we still found colours would bleed across tenants and across browser sessions.
After an awful lot of debugging and messing with IIS settings we found that the following process occurred in code with the following outcome:

...
LessTranslator is instantiated. This has an empty ModifyVariables property
LessTranslator.ModifyVariables is then updated with our values from the database. This has the correct values at this point
Some asset work occurs
LessTranslator.Translate is called which in turn calls CreateCompilationOptions. The ModifyVariables property now has values from another browser session.

So something is not thread safe, but we cannot work out what. The problem is always seen after an IISReset and we try to access different tenants from different browsers as concurrently as possible, i.e. clicking refresh in each browser as quickly as possible.

Has anyone seen this problem before? What information would you need to help us?

Regards,

Craig
Comments: Taritsyn, I'll have a read over the weekend , thank you. Regards, Craig

Closed Unassigned: Less to CSS: ModifyVariables changing across browser sessions [121]

$
0
0
Hello,
We have a very strange problem first noticed in our live multi-tenant environment. Each tenant is able to store a number of theme variables, hex colour codes in a database. The bundle transformer code references a .less file and compiles to CSS with these theme variables (ModifyVariables). We noticed one tenant would randomly see theme colours of another tenant.
Back in development and during debugging we made sure on each Application BeginRequest to invalidate the cache and rebuild the theme CSS on every request. With multiple browsers running against different tenants we still found colours would bleed across tenants and across browser sessions.
After an awful lot of debugging and messing with IIS settings we found that the following process occurred in code with the following outcome:

...
LessTranslator is instantiated. This has an empty ModifyVariables property
LessTranslator.ModifyVariables is then updated with our values from the database. This has the correct values at this point
Some asset work occurs
LessTranslator.Translate is called which in turn calls CreateCompilationOptions. The ModifyVariables property now has values from another browser session.

So something is not thread safe, but we cannot work out what. The problem is always seen after an IISReset and we try to access different tenants from different browsers as concurrently as possible, i.e. clicking refresh in each browser as quickly as possible.

Has anyone seen this problem before? What information would you need to help us?

Regards,

Craig

Commented Unassigned: LESS: Data-uri with variables and mixins [112]

$
0
0
The LESS function data-uri does not currently work properly in combination with LESS variables or LESS mixins.

The data URI processing happens too early, based on what's explicitly written in the LESS file, rather than what the result will be after processing variables and mixins.

A mixin such as this does not currently work when used somewhere in a LESS file:

``` CSS
.backgroundImage(@url) {
background-image: data-uri(@url);
}
```

You can test this in the TestLess.less file in the Example.Mvc project:
``` CSS
.icon-monitor
{
display: inline;
background-image: data-uri(@monitor-icon-url);
}
```

It will not create a data uri of that image, but simply create the regular url(filepath) value.

So the processing of these data-uri functions should perhaps be delayed until later when a compiled CSS has been made after variables and mixins have been run.
Comments: Hello, George! In [Bundle Transformer 1.9.92](https://bundletransformer.codeplex.com/releases/view/620266) solved this problem.

Edited Feature: LESS: Data-uri with variables and mixins [112]

$
0
0
The LESS function data-uri does not currently work properly in combination with LESS variables or LESS mixins.

The data URI processing happens too early, based on what's explicitly written in the LESS file, rather than what the result will be after processing variables and mixins.

A mixin such as this does not currently work when used somewhere in a LESS file:

``` CSS
.backgroundImage(@url) {
background-image: data-uri(@url);
}
```

You can test this in the TestLess.less file in the Example.Mvc project:
``` CSS
.icon-monitor
{
display: inline;
background-image: data-uri(@monitor-icon-url);
}
```

It will not create a data uri of that image, but simply create the regular url(filepath) value.

So the processing of these data-uri functions should perhaps be delayed until later when a compiled CSS has been made after variables and mixins have been run.

Reopened Unassigned: SCSS: Incorrect url rewrite with variable in url [80]

$
0
0
If using SCSS and bundling without valiables everything works:

this (scss file is in 'Static/Styles' folder):
```
body {
background: url('../Images/back.png') 0 0;
}
```

compiles into:
```
body {
background: url('/Static/Images/back.png') 0 0;
}
```

But! When adding variable to this example:
```
$path: '../Images';
body {
background: url('#{$path}/back.png') 0 0;
}
```

compiles into:
```
body {
background: url('/Static/Styles/../Images/back.png') 0 0;
}
```

I'm using UrlRewritingCssPostProcessor. Why behavior is different? Postprocessor must be working after translating scss into css, isn't he?

Edited Feature: SCSS: Incorrect url rewrite with variable in url [80]

$
0
0
If using SCSS and bundling without valiables everything works:

this (scss file is in 'Static/Styles' folder):
```
body {
background: url('../Images/back.png') 0 0;
}
```

compiles into:
```
body {
background: url('/Static/Images/back.png') 0 0;
}
```

But! When adding variable to this example:
```
$path: '../Images';
body {
background: url('#{$path}/back.png') 0 0;
}
```

compiles into:
```
body {
background: url('/Static/Styles/../Images/back.png') 0 0;
}
```

I'm using UrlRewritingCssPostProcessor. Why behavior is different? Postprocessor must be working after translating scss into css, isn't he?

Commented Unassigned: Relative urls are not resolved in LESS files [75]

$
0
0
My problem is similar to https://bundletransformer.codeplex.com/workitem/68

I'm trying to use the LESS Bundle Transformer with the Twitter.Bootstrap.Less nuget package, but the glyphicon urls are not being resolved to absolute urls. All the other LESS translation to CSS and CSS minification is working fine.

Eg. url('../fonts/glyphicons-halflings-regular.eot');

I tested this against CssUrlRuleRegex and it gets a successful match.
Comments: Hello, User22! In [Bundle Transformer 1.9.92](https://bundletransformer.codeplex.com/documentation) solved this problem.

Reopened Unassigned: Relative urls are not resolved in LESS files [75]

$
0
0
My problem is similar to https://bundletransformer.codeplex.com/workitem/68

I'm trying to use the LESS Bundle Transformer with the Twitter.Bootstrap.Less nuget package, but the glyphicon urls are not being resolved to absolute urls. All the other LESS translation to CSS and CSS minification is working fine.

Eg. url('../fonts/glyphicons-halflings-regular.eot');

I tested this against CssUrlRuleRegex and it gets a successful match.

Edited Feature: Relative urls are not resolved in LESS files [75]

$
0
0
My problem is similar to https://bundletransformer.codeplex.com/workitem/68

I'm trying to use the LESS Bundle Transformer with the Twitter.Bootstrap.Less nuget package, but the glyphicon urls are not being resolved to absolute urls. All the other LESS translation to CSS and CSS minification is working fine.

Eg. url('../fonts/glyphicons-halflings-regular.eot');

I tested this against CssUrlRuleRegex and it gets a successful match.

Commented Feature: Relative urls are not resolved in LESS files [75]

$
0
0
My problem is similar to https://bundletransformer.codeplex.com/workitem/68

I'm trying to use the LESS Bundle Transformer with the Twitter.Bootstrap.Less nuget package, but the glyphicon urls are not being resolved to absolute urls. All the other LESS translation to CSS and CSS minification is working fine.

Eg. url('../fonts/glyphicons-halflings-regular.eot');

I tested this against CssUrlRuleRegex and it gets a successful match.
Comments: Hello, User22! In [Bundle Transformer 1.9.92](https://bundletransformer.codeplex.com/releases/view/620266) solved this problem.

Commented Feature: LESS: Data-uri with variables and mixins [112]

$
0
0
The LESS function data-uri does not currently work properly in combination with LESS variables or LESS mixins.

The data URI processing happens too early, based on what's explicitly written in the LESS file, rather than what the result will be after processing variables and mixins.

A mixin such as this does not currently work when used somewhere in a LESS file:

``` CSS
.backgroundImage(@url) {
background-image: data-uri(@url);
}
```

You can test this in the TestLess.less file in the Example.Mvc project:
``` CSS
.icon-monitor
{
display: inline;
background-image: data-uri(@monitor-icon-url);
}
```

It will not create a data uri of that image, but simply create the regular url(filepath) value.

So the processing of these data-uri functions should perhaps be delayed until later when a compiled CSS has been made after variables and mixins have been run.
Comments: Thumbs up! :)

Commented Unassigned: Missing data-uri image will cause 500 error in Less Preprocessor [84]

$
0
0

If you have an incorrect data-uri reference:
```
background-image: data-uri('nonexistant.png; )
```
... then your website won't start and you receive a 500 error. I believe this is because the BundleRegistration in App_Start throws the FileNotFound error.

This seems a pretty harsh failure.

I suggest that in in Production mode it doesn't rewrite the css at all, and hence the error will be quickly caught by the console. In Development mode then it should be reported. But the nature of css is not to completely die when a file is not found, and I don't believe the preprocessor should either.

Thanks.
Comments: Hello! In [BundleTransformer.Less 1.9.92](https://www.nuget.org/packages/BundleTransformer.Less/1.9.92) errors like “Skipped data-uri embedding of nonexistant.png; because file not found” and “Skipped data-uri embedding of ../fonts/blogger-sans/blogger-sans-webfont.eot because its size (131090 characters) exceeds IE8-safe 32768 characters!” now are considered as warnings. By default, warnings are not visible, but if in the configuration settings of LESS-translator set to the `Severity` property value equal to `1`, then it will thrown as exceptions.

Created Unassigned: Add hash tot css / less referenced assets. [122]

$
0
0
Hi, I'm trying to optimize the cashing of our assets by increasing it's cache timeout. The thing is, I can't get BundleTransformer to append hashes to the end of files referenced by `url()` values in my LESS files. All of the files are available locally, so it shouldn't be too much of an issue to get it's md5 hash, or anything similar.

Should I write my own BundleTransformer extension, or has this been done before? As I can only assume people have done this before me.

Edited Unassigned: Add hash to referenced assets in StyleBundle. [122]

$
0
0
Hi, I'm trying to optimize the cashing of our assets by increasing it's cache timeout. The thing is, I can't get BundleTransformer to append hashes to the end of files referenced by `url()` values in my LESS files. All of the files are available locally, so it shouldn't be too much of an issue to get it's md5 hash, or anything similar.

Should I write my own BundleTransformer extension, or has this been done before? As I can only assume people have done this before me.

Commented Unassigned: Add hash to referenced assets in StyleBundle. [122]

$
0
0
Hi, I'm trying to optimize the cashing of our assets by increasing it's cache timeout. The thing is, I can't get BundleTransformer to append hashes to the end of files referenced by `url()` values in my LESS files. All of the files are available locally, so it shouldn't be too much of an issue to get it's md5 hash, or anything similar.

Should I write my own BundleTransformer extension, or has this been done before? As I can only assume people have done this before me.
Comments: Hello, Guido! Theoretically this can be done by implementing the `GetBundleContents` method of [`IBundleResolver`](http://aspnetoptimization.codeplex.com/SourceControl/latest#src/System.Web.Optimization/IBundleResolver.cs) interface from [System.Web.Optimization](http://aspnetoptimization.codeplex.com/) library. The basis I recommend to take a [`CustomBundleResolver`](https://bundletransformer.codeplex.com/SourceControl/latest#BundleTransformer.Core/Resolvers/CustomBundleResolver.cs) class from Bundle Transformer.

Created Unassigned: Make BundleTransformerContext constructor public to override properties [123]

$
0
0
Please make it possible to customize BundleTransformerContext. Add constructor with IConfigurationManager.
I don't want to configure everything in web.config - it's too clunky and require too copy paste web configs from documentation. I want to do all available registrations from code.

Commented Unassigned: Make BundleTransformerContext constructor public to override properties [123]

$
0
0
Please make it possible to customize BundleTransformerContext. Add constructor with IConfigurationManager.
I don't want to configure everything in web.config - it's too clunky and require too copy paste web configs from documentation. I want to do all available registrations from code.
Comments: Hello, AlfeG! > I want to do all available registrations from code. I recommend you to look the overloaded versions of constructors of the `StyleTransformer` and `ScriptTransformer classes`: ``` using System.Collections.Generic; using System.Web.Optimization; using BundleTransformer.Core.Builders; using BundleTransformer.Core.Orderers; using BundleTransformer.Core.PostProcessors; using BundleTransformer.Core.Resolvers; using BundleTransformer.Core.Transformers; using BundleTransformer.Core.Translators; using BundleTransformer.Autoprefixer.PostProcessors; using BundleTransformer.CoffeeScript.Translators; using BundleTransformer.Handlebars.Translators; using BundleTransformer.Hogan.Translators; using BundleTransformer.Less.Translators; using BundleTransformer.MicrosoftAjax; using BundleTransformer.MicrosoftAjax.Minifiers; using BundleTransformer.SassAndScss.Translators; using BundleTransformer.TypeScript.Translators; namespace BundleTransformer.Example.Mvc { public class BundleConfig { // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725 public static void RegisterBundles(BundleCollection bundles) { bundles.UseCdn = true; var nullBuilder = new NullBuilder(); var nullOrderer = new NullOrderer(); var msAjaxCssMinifier = new MicrosoftAjaxCssMinifier { ColorNames = CssColor.Major }; var lessTranslator = new LessTranslator { StrictMath = true }; var sassAndScssTranslator = new SassAndScssTranslator(); var urlRewritingCssPostProcessor = new UrlRewritingCssPostProcessor(); var autoprefixCssPostProcessor = new AutoprefixCssPostProcessor(); var styleTransformer = new StyleTransformer( msAjaxCssMinifier, new List<ITranslator> { lessTranslator, sassAndScssTranslator }, new List<IPostProcessor> { urlRewritingCssPostProcessor, autoprefixCssPostProcessor } ) { CombineFilesBeforeMinification = true }; var microsoftAjaxJsMinifier = new MicrosoftAjaxJsMinifier { RemoveUnneededCode = true }; var coffeeScriptTranslator = new CoffeeScriptTranslator { Bare = false }; var typeScriptTranslator = new TypeScriptTranslator(); var hoganTranslator = new HoganTranslator(); var handlebarsTranslator = new HandlebarsTranslator(); var scriptTransformer = new ScriptTransformer( microsoftAjaxJsMinifier, new List<ITranslator> { coffeeScriptTranslator, typeScriptTranslator, hoganTranslator, handlebarsTranslator }) { CombineFilesBeforeMinification = true }; // Replace a default bundle resolver in order to the debugging HTTP-handler // can use transformations of the corresponding bundle BundleResolver.Current = new CustomBundleResolver(); var commonStylesBundle = new Bundle("~/Bundles/CommonStyles"); commonStylesBundle.Include( "~/Content/Fonts.css", "~/Content/Site.css", "~/Content/BundleTransformer.css", "~/AlternativeContent/css/TestCssComponentsPaths.css", "~/Content/themes/base/jquery.ui.core.css", "~/Content/themes/base/jquery.ui.theme.css", "~/Content/themes/base/jquery.ui.resizable.css", "~/Content/themes/base/jquery.ui.button.css", "~/Content/themes/base/jquery.ui.dialog.css", "~/Content/TestTranslators.css", "~/Content/less/TestLess.less", "~/Content/sass/TestSass.sass", "~/Content/scss/TestScss.scss"); commonStylesBundle.Builder = nullBuilder; commonStylesBundle.Transforms.Add(styleTransformer); commonStylesBundle.Orderer = nullOrderer; bundles.Add(commonStylesBundle); var modernizrBundle = new Bundle("~/Bundles/Modernizr"); modernizrBundle.Include("~/Scripts/modernizr-2.*"); modernizrBundle.Builder = nullBuilder; modernizrBundle.Transforms.Add(scriptTransformer); modernizrBundle.Orderer = nullOrderer; bundles.Add(modernizrBundle); var jQueryBundle = new Bundle("~/Bundles/Jquery", "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.2.1.min.js"); jQueryBundle.Include("~/Scripts/jquery-{version}.js"); jQueryBundle.Builder = nullBuilder; jQueryBundle.Transforms.Add(scriptTransformer); jQueryBundle.Orderer = nullOrderer; jQueryBundle.CdnFallbackExpression = "window.jquery"; bundles.Add(jQueryBundle); var commonScriptsBundle = new Bundle("~/Bundles/CommonScripts"); commonScriptsBundle.Include( "~/Scripts/MicrosoftAjax.js", "~/Scripts/jquery-ui-{version}.js", "~/Scripts/jquery.validate.js", "~/Scripts/jquery.validate.unobtrusive.js", "~/Scripts/jquery.unobtrusive-ajax.js", "~/Scripts/knockout-3.*", "~/Scripts/coffee/TestCoffeeScript.coffee", "~/Scripts/coffee/TestLiterateCoffeeScript.litcoffee", "~/Scripts/coffee/TestCoffeeScriptMarkdown.coffee.md", "~/Scripts/ts/TranslatorBadge.ts", "~/Scripts/ts/ColoredTranslatorBadge.ts", "~/Scripts/ts/TestTypeScript.ts"); commonScriptsBundle.Builder = nullBuilder; commonScriptsBundle.Transforms.Add(scriptTransformer); commonScriptsBundle.Orderer = nullOrderer; bundles.Add(commonScriptsBundle); var commonTemplatesBundle = new Bundle("~/Bundles/CommonTemplates"); commonTemplatesBundle.Include( "~/Scripts/hogan/template-{version}.js", "~/Scripts/hogan/HoganTranslatorBadge.mustache", "~/Scripts/hogan/TestHogan.js", "~/Scripts/handlebars/handlebars.runtime.js", "~/Scripts/handlebars/HandlebarsHelpers.js", "~/Scripts/handlebars/HandlebarsTranslatorBadge.handlebars", "~/Scripts/handlebars/TestHandlebars.js"); commonTemplatesBundle.Builder = nullBuilder; commonTemplatesBundle.Transforms.Add(scriptTransformer); commonTemplatesBundle.Orderer = nullOrderer; bundles.Add(commonTemplatesBundle); } } } ``` > I don't want to configure everything in web.config - it's too clunky and require too copy paste web configs from documentation. You do not need to copy code from the documentation, because the basic settings are added when installing NuGet packages. In the simplest case, you only need to set value of the `defaultMinifier` attribute. If you need to override the default settings of minifier/translator/postprocessor, then the [BundleTransformer.ConfigurationIntelliSense](http://www.nuget.org/packages/BundleTransformer.ConfigurationIntelliSense/) package will help you with this.

Closed Unassigned: Make BundleTransformerContext constructor public to override properties [123]

$
0
0
Please make it possible to customize BundleTransformerContext. Add constructor with IConfigurationManager.
I don't want to configure everything in web.config - it's too clunky and require too copy paste web configs from documentation. I want to do all available registrations from code.

Edited Unassigned: Add hash to referenced assets in StyleBundle. [122]

$
0
0
Hi, I'm trying to optimize the caching of our assets by increasing it's cache timeout. The thing is, I can't get BundleTransformer to append hashes to the end of files referenced by `url()` values in my LESS files. All of the files are available locally, so it shouldn't be too much of an issue to get it's md5 hash, or anything similar.

Should I write my own BundleTransformer extension, or has this been done before? As I can only assume people have done this before me.

Created Unassigned: bug with last version [124]

$
0
0
Hello, when install last version of bundle transformer i get error :

> Server Error in '/' Application.

During the output text content of processed asset an unknown error has occurred.
See more details:
Exception has been thrown by the target of an invocation.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: During the output text content of processed asset an unknown error has occurred.
See more details:
Exception has been thrown by the target of an invocation.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[HttpException (0x80004005): During the output text content of processed asset an unknown error has occurred.
See more details:
Exception has been thrown by the target of an invocation.]
BundleTransformer.Core.HttpHandlers.AssetHandlerBase.ProcessRequest(HttpContextBase context) +1707
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +508
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +96

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.118.0




It only works with these packages:
<package id="BundleTransformer.Core" version="1.9.25" targetFramework="net452" />
<package id="BundleTransformer.Less" version="1.9.25" targetFramework="net452" />
<package id="JavaScriptEngineSwitcher.Core" version="1.2.4" targetFramework="net452" />
<package id="JavaScriptEngineSwitcher.V8" version="1.2.0" targetFramework="net452" />
Viewing all 698 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>