Skip to content

SCSS compiled to empty CSS with BuildWebCompiler2022 1.14.15 (works in 1.14.10) #119

@LeadMagnet

Description

@LeadMagnet

Title: SCSS compiled to empty CSS with BuildWebCompiler2022 1.14.15 (works in 1.14.10)

Environment

  • Visual Studio 2022 (latest at time of writing)
  • .NET SDK: .NET 8.0
  • Project type: ASP.NET Core Web (Sdk =Microsoft.NET.Sdk.Web)
  • OS: Windows 10/11
  • Package: BuildWebCompiler2022
  • Working version: 1.14.10
  • Problem version: 1.14.15

Project setup
.csproj (relevant parts):
net8.0enableenable

compilerconfig.json:
[
{
"outputFile": "wwwroot/Content/css/StyleSheet.css",
"inputFile": "wwwroot/Content/scss/StyleSheet.scss"
}
]

Folder structure under the project root:

  • wwwroot/Content/scss/StyleSheet.scss
  • wwwroot/Content/css/StyleSheet.css

Minimal SCSS content (repro):
body {
h1 {
color: green;
}
}

Steps to reproduce

  1. Create the project structure above withBuildWebCompiler2022 1.14.15referenced.
  2. Add compilerconfig.json as shown.
  3. Create wwwroot/Content/scss/StyleSheet.scss with the SCSS snippet above.
  4. Build the project in Visual Studio 2022 (or viadotnet build).

Expected behaviour

  • Build succeeds.
  • wwwroot/Content/css/StyleSheet.css contains:
    (or equivalent expanded output).

Actual behaviour with 1.14.15

  • Build succeeds (no visible errors or warnings in the Build output).
  • wwwroot/Content/css/StyleSheet.css is recreated but empty (0 bytes or no CSS rules).
  • If the CSS file is deleted before build, it is recreated as an empty file.
  • No clear indication in the build log that compilation failed or skipped.

Comparison with 1.14.10

  • If I change only the package version in the .csprojto:
and keep everything else exactly the same:
  • Build succeeds.
  • StyleSheet.css is generated correctly with the expected CSS content.

So the same project, config, and SCSS:

  • Works as expected in 1.14.10.
  • Produces an empty CSS file (without errors) in1.14.15.

Notes

  • Using the official sass npm package (sass wwwroot/Content/scss:wwwroot/Content/css) on the same SCSS file produces correct CSS, confirming the SCSS itself and paths are valid.
  • This suggests a regression or breaking change between 1.14.10 and 1.14.15 where SCSS compilation can silently fail or produce empty output without logging an error.

body h1 {
color: green;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions