Skip to content

[Blazor] MapStaticAssets incorrectly re-encodes files when running the published output in the development environment. #56742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
javiercn opened this issue Jul 11, 2024 · 1 comment
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug.

Comments

@javiercn
Copy link
Member

We have a handler that runs in development to detect files that were added after the build step and serve them as static asset endpoints. We also have logic to gzip those files to serve the gzip version. This logic is only ever wired up when the environment is Development.

When someone publishes their app and sets the environment to Development, the handler gets wired up and incorrectly re-encodes some of the already encoded brotli versions of the files.

This can happen when the app runs inside Visual Studio inside a Docker container using the <ContainerDevelopmentMode>Regular</ContainerDevelopmentMode>.

There is a configuration value that can be set to avoid wiring up this behavior that takes precedence over the Development check.

We can do three things:

  • Document the flag and tell people to set it in this scenario.
  • Update the logic to ensure that brotli files don't get incorrectly re-encoded.
  • Update the logic in the SDK to include a flag in the manifest and unconditionally disable the feature during publish.

We don't expect people to do this outside of the docker scenario mentioned above, but we want to make sure we have some resolution for it.

@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Jul 11, 2024
@MackinnonBuck MackinnonBuck added this to the .NET 10 Planning milestone Jul 11, 2024
@MackinnonBuck MackinnonBuck added the bug This issue describes a behavior which is not expected - a bug. label Jul 11, 2024
@javiercn
Copy link
Member Author

This was fixed in 9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug.
Projects
None yet
Development

No branches or pull requests

2 participants