Comments (8)
Hello!
I tried to fix all the above errors in version 2.13.0.
from webmarkupmin.
Looks like the update fixed the problem. Tested on more complex code that experienced it (and the minimal code) and looks like it works like a charm now.
Thanks for looking into this and the update :)
from webmarkupmin.
Hello!
Try disabling a brotli compression.
from webmarkupmin.
NO effect.
I commented package
WebMarkupMin.AspNet.Brotli" Version="2.10.0"
then commented
//new BrotliCompressorFactory(new BrotliCompressionSettings
//{
// Level = 1
//}),
still no change.
from webmarkupmin.
Try to reproduce this error in the form of demo project and send me a link to it.
from webmarkupmin.
I think I have similar problem where WebMarkupMin at random times gives empty page response (0 bytes).
This occurs if I have AllowCompressionInDevelopmentEnvironment
set to true
. So to avoid this bug AllowCompressionInDevelopmentEnvironment
needs to be set to false
.
It is hard to reproduce since when it occurs it is either every second pageload is empty or it gets into an mode of many empty loads then many good loads. And thus I have not been able to pinpoint to the actual cause and produce a bugtest code.
I've tried to narrow down the code that causes without luck. When I think I have it narrowed down (consistently trigger bug) and try to make bugtest code by removing unrelated pure HTML it suddenly don't occur any more for no apparent reason.
But I suspect bug is related to async ViewComponent
or Html.PartialAsync
calls, but this is pure speculation.
One additional thing I noticed in logs is that when page loads correctly the Microsoft.AspNetCore.Watch.BrowserRefresh.BrowserRefreshMiddleware
failed to load and these two Debug messages are logged (neither is present in log when 0 byes page is served).
DBG - Response markup is scheduled to include browser refresh script injection.
DBG - Unable to configure browser refresh script injection on the response.
I hope some of this info will help you narrow down what the cause might be.
I have not tested in production environment to see if bug is present there too with the code I have yet
from webmarkupmin.
Created a minimal code that causes the error
Running ASP .Net 6 (6.0.402)
using Microsoft.AspNetCore.Builder;
using WebMarkupMin.AspNetCore6;
using WebMarkupMin.AspNet.Common.UrlMatchers;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddWebMarkupMin(options =>
{
options.AllowCompressionInDevelopmentEnvironment = true;
})
.AddHttpCompression(
// There is always an option to exclude the routes that returns string and not IActionResult to make it work
//options.ExcludedPages = new List<IUrlMatcher> {new ExactUrlMatcher("/") };
});
var app = builder.Build();
app.UseWebMarkupMin();
// Will become blank if AllowCompressionInDevelopmentEnvironment is true or Production enviroment.
// ...and cause an "Headers are read-only, response has already started." Exception
app.MapGet("/", () => "Will become blank and cause error.");
app.Run();
from webmarkupmin.
In this case, it was possible to fix only reproducible errors that lead to the display of a blank page. But, unfortunately, there are also non-reproducible errors.
from webmarkupmin.
Related Issues (20)
- problem dont use Quotes in Html Attribute HOT 2
- [WebMarkupMin.AspNetCore5] Sometimes a blank page is returned as the request has no response data available HOT 30
- Minified attributes seem to be double encoded HOT 4
- More a question, not an "issue" HOT 9
- .NET 7 broke BrotliCompressor due to invalid compression levels HOT 4
- ArgumentNullException: Value cannot be null. (Parameter 'destination') HOT 4
- Hmmm… can't reach this page It looks like the webpage HOT 1
- object ref error with WebMarkupMin.AspNetCore7. HOT 3
- Whitespace trimming on anchor tags (when using svg tag) HOT 28
- Minification Failing - GTM no script tags breaking minification HOT 5
- The minifier does not compress the content if there is code in the html HOT 2
- DotNet 8 support HOT 3
- <button> type attribute with "submit" value is removed HOT 1
- Previously worked HOT 11
- XML minification HOT 6
- Question regarding asp.net webforms > .ascx HOT 9
- Unclosed td / th tags on PartialView HOT 2
- Invalid HTML Minification Result HOT 2
- .NET 6 -> .NET 8 (Markup minification not working) HOT 1
- Encoding in HtmlAttributeValueHelpers breaks Third Party JS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webmarkupmin.