Skip to content

Drive case insensitivity on Windows causes "Error BLAZOR105: More than one JS module files were found for the razor component" (but there isn't) #62021

@bitbound

Description

@bitbound

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

The BLAZOR105 error gets thrown on Windows after building with dotnet build {path} three times:

  • Once with upper-case drive letter.
  • Once with lower-case drive letter.
  • Again with lower-case drive letter.

There is only one module file. It appears somewhere in the flow, it's overlooked that paths are case-insensitive on Windows.

Image

Note: I'm using [JSImport] in this component. This started after upgrading from Microsoft.AspNetCore.Components.WebAssembly from 9.0.3 to 9.0.5. But it might have existed previously, and my workflow just never triggered it.

Expected Behavior

I should be able to build on Windows regardless of drive/path capitalization.

Steps To Reproduce

On Windows 11. This repros it consistently for me (pwsh 7).

git clone https://github.com/bitbound/Blazor105
dotnet build "$($PWD.Path)\Blazor105\Blazor105.sln"
dotnet build "$($PWD.Path.ToLower())\Blazor105\Blazor105.sln"
dotnet build "$($PWD.Path.ToLower())\Blazor105\Blazor105.sln"

Manual steps, in case that doesn't work:

  • Clone https://github.com/bitbound/Blazor105
  • Open in VS 2022
  • Build solution
  • Open Terminal
  • Run dotnet build "c:\{sln-dir}\Blazor105\Blazor105\Blazor105.csproj"
    • Note the lower-case drive letter.
    • Run command at least twice.
    • Exception seems to occur on second run.

Exceptions (if any)

  Blazor105.Client failed with 1 error(s) (0.2s)
    Pages\Counter.razor : error BLAZOR105:
      More than one JS module files were found for the razor component 'Pages\Counter.razor'. Each razor component must
      have at most a single associated JS module file.
      C:\Repos\Blazor105\Blazor105\Blazor105.Client\Pages\Counter.razor.js
      c:\Repos\Blazor105\Blazor105\Blazor105.Client\Pages\Counter.razor.js

.NET Version

9.0.300

Anything else?

.NET SDK:
 Version:           9.0.300
 Commit:            15606fe0a8
 Workload version:  9.0.300-manifests.87b8cca8
 MSBuild version:   17.14.5+edd3bbf37

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.26100
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\9.0.300\

.NET workloads installed:
 [android]
   Installation Source: SDK 9.0.300, VS 17.14.36109.1
   Manifest Version:    35.0.61/9.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.android\35.0.61\WorkloadManifest.json
   Install Type:              Msi

 [ios]
   Installation Source: SDK 9.0.300, VS 17.14.36109.1
   Manifest Version:    18.4.9289/9.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.ios\18.4.9289\WorkloadManifest.json
   Install Type:              Msi

 [maccatalyst]
   Installation Source: SDK 9.0.300, VS 17.14.36109.1
   Manifest Version:    18.4.9289/9.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maccatalyst\18.4.9289\WorkloadManifest.json
   Install Type:              Msi

 [maui-windows]
   Installation Source: SDK 9.0.300, VS 17.14.36109.1
   Manifest Version:    9.0.51/9.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maui\9.0.51\WorkloadManifest.json
   Install Type:              Msi

Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.5
  Architecture: x64
  Commit:       e36e4d1a8f

.NET SDKs installed:
  9.0.300 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 8.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions