Coder Social home page Coder Social logo

Comments (4)

Taritsyn avatar Taritsyn commented on June 11, 2024 1

Hello, Bruno!

Today I fixed another small defect and released version 2.13.4.

… Now we are getting some blank screens. …

This problem started when we upgraded from net6.0 to net7.0.

Prior to version 2.13.0, as a rule, such errors occurred for 2 reasons: due to outdated implementation of the BodyWrapperStreamBase class and peculiarities of disposing an empty instance of the BrotliStream class. Now, in most cases, such errors no longer occur (“[WebMarkupMin.AspNetCore5] Sometimes a blank page is returned as the request has no response data available” and “Blank page response”). It is quite possible that you are using an extension focused on old version of ASP.NET Core and you should replace it by the WebMarkupMin.AspNetCore7 package.

… Some Views work fine and others don't.

It is possible that some Views contain HTML code with syntax errors. Therefore, I recommend you to write your own logger or use the built-in logger (ThrowExceptionLogger class). In your case, the logger for WebMarkupMin needs to be registered in the Program.cs file as follows:

using IWmmLogger = WebMarkupMin.Core.Loggers.ILogger;
using WmmThrowExceptionLogger = WebMarkupMin.Core.Loggers.ThrowExceptionLogger;var builder = WebApplication.CreateBuilder(args);// Override the default logger for WebMarkupMin.
builder.Services.AddSingleton<IWmmLogger, WmmThrowExceptionLogger>();

from webmarkupmin.

brunobritodev avatar brunobritodev commented on June 11, 2024

We are facing the same problem.

from webmarkupmin.

Taritsyn avatar Taritsyn commented on June 11, 2024

Hello!

Thanks for information! Try updating to version 2.13.3.

from webmarkupmin.

brunobritodev avatar brunobritodev commented on June 11, 2024

Hi @Taritsyn thx for your efforts and support.

I've updated to latest version and the error changed. Now we are getting some blank screens. I've no clue which info to send you. Some Views work fine and others don't.

I see some changes in code to prevent the _compressionStream from null at BodyWrapperStreamBase, This was the problematic line.

This problem started when we upgraded from net6.0 to net7.0.

But there is an workaround:

Our code

builder.Services
            .AddWebMarkupMin(options =>
            {
                options.AllowMinificationInDevelopmentEnvironment = true;
                options.AllowCompressionInDevelopmentEnvironment = true;  
            })
            .AddHtmlMinification()
            .AddXmlMinification()
            .AddHttpCompression(options => { options.ExcludedPages = new List<IUrlMatcher> { new WildcardUrlMatcher("/health*") }; });

If I change to this:

builder.Services
            .AddWebMarkupMin(options =>
            {
                options.AllowMinificationInDevelopmentEnvironment = true;
                options.AllowCompressionInDevelopmentEnvironment = true;  
            })
            .AddHtmlMinification(options =>
            {
                HtmlMinificationSettings settings = options.MinificationSettings;
                settings.RemoveRedundantAttributes = true;
                settings.RemoveHttpProtocolFromAttributes = true;
                settings.RemoveHttpsProtocolFromAttributes = true;

                options.CssMinifierFactory = new NUglifyCssMinifierFactory();
                options.JsMinifierFactory = new NUglifyJsMinifierFactory();
            })
            .AddXmlMinification()
            .AddHttpCompression(options => { options.ExcludedPages = new List<IUrlMatcher> { new WildcardUrlMatcher("/health*") }; });

It start to work again.

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.