Coder Social home page Coder Social logo

Comments (11)

christopherdude avatar christopherdude commented on June 11, 2024

I should also note - this works in DEV, but not in PROD. And yes, I have everything set to configure for usage, no matter the environment. There weren't any new "server" requirements, were there?

from webmarkupmin.

Taritsyn avatar Taritsyn commented on June 11, 2024

Hello, Christopher!

Are you using the following settings?

public class WebMarkupMinConfig
    {
        public static void Configure(WebMarkupMinConfiguration configuration)
        {
            configuration.AllowMinificationInDebugMode = true;
            configuration.AllowCompressionInDebugMode = true;

It is also possible that errors occur when parsing HTML content. I recommend you to write your own logger or use the built-in logger (ThrowExceptionLogger class). If you use ASP.NET Web Forms, then the logger for WebMarkupMin needs to be registered in the App_Start/WebMarkupMinConfig.cs file as follows:

using WebMarkupMin.Core.Loggers;
…
DefaultLogger.Current = new ThrowExceptionLogger();

from webmarkupmin.

Taritsyn avatar Taritsyn commented on June 11, 2024

Hello, Christopher!

Did my advice help you?

from webmarkupmin.

christopherdude avatar christopherdude commented on June 11, 2024

from webmarkupmin.

christopherdude avatar christopherdude commented on June 11, 2024

By commenting out the following line, everything seems to work..

DefaultJsMinifierFactory.Current = new MsAjaxJsMinifierFactory();

from webmarkupmin.

Taritsyn avatar Taritsyn commented on June 11, 2024

Hello, Christopher!

Category: JS_MINIFICATION_ERROR
Message: Expected '(': {
File: /
Line number: 772
Column number: 19
Source fragment:

Line 771:             }
Line 772:             catch {
-----------------------------^
Line 773:                 //debugger;

It seems that JS minifier perceives the catch block without a exception value as syntax error.

It expects instead of this line:

    catch {

Expects the following line:

    catch (e) {

If you are using the WebMarkupMin.MsAjax or WebMarkupMin.Yui module, then replace it with a more modern module - WebMarkupMin.NUglify:

from webmarkupmin.

christopherdude avatar christopherdude commented on June 11, 2024

Will do - thanks for the fast reply. I'm actually using the latest 2.14.0 from NuGet. Does that not have that latest module?

from webmarkupmin.

Taritsyn avatar Taritsyn commented on June 11, 2024

After installing the WebMarkupMin.NUglify module, this line:

DefaultJsMinifierFactory.Current = new MsAjaxJsMinifierFactory();

Need to be replaced with the following line:

DefaultJsMinifierFactory.Current = new NUglifyJsMinifierFactory();

from webmarkupmin.

Taritsyn avatar Taritsyn commented on June 11, 2024

I'm actually using the latest 2.14.0 from NuGet. Does that not have that latest module?

Microsoft Ajax Minifier and YUI Compressor for .NET libraries have been deprecated.

It looks like you are using a WebMarkupMin.MsAjax module. Uninstall the WebMarkupMin.MsAjax package and then install the WebMarkupMin.NUglify package. Replace the corresponding namespaces and update the code as in the previous post.

from webmarkupmin.

christopherdude avatar christopherdude commented on June 11, 2024

That did it! Thank you so much. By the way, do you have a minification setting in here for *.svg?

from webmarkupmin.

Taritsyn avatar Taritsyn commented on June 11, 2024

The WebMarkupMin does not have an SVG minifier.

If SVG code is embedded in HTML code, then it is minified according to rules similar to XML minification.

For individual .svg files, you can use an XML minifier (embedded scripts and styles will not be modified). But .svg files are static files and the WebMarkupMin.AspNet4.WebForms module will not work for them. For static files, you will need a WebMarkupMin.AspNet4.HttpModules module with XmlMinificationModule and may require special IIS configuration.

from webmarkupmin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.