You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also, in case it helps anyone... if you renamed the local environment name from Development to something else (for instance, I call it local), then you need to ensure that you call builder.WebHost.UseStaticWebAssets() BEFORE you call pipeline.AddScssBundle. This will ensure that env.WebRootFileProvider is a CompositeFileProvider, not a PhysicalFileProvider.
When calling UseFileProvider, if env.WebRootFileProvider is not already a CompositeFileProvider, then it will not work, and you need to rearrange your middleware.
The reason the environment name is relevant here is ASP.NET Core will automatically call UseStaticWebAssets for you if HostingEnvironment.IsDevelopment() returns true (which will then take care of switching the WebRootFileProvider to use CompositeFileProvider). But if you renamed the environment, then this configuration is no longer automatic and you must perform it yourself.
Just posting this in case it helps anyone, took a while to figure this out.
When adding an scss bundle with source files from a Razor Class Library project:
SCSS compilation fails with the following error:
It works fine when creating a plain CSS bundle:
So it is just the SCSS compiler that is throwing an error.
Refer to this PR for how it was fixed in the main WebOptimizer project:
https://github.com/ligershark/WebOptimizer/pull/287/files
The text was updated successfully, but these errors were encountered: