Skip to content

error BLAZOR106: The JS module file 'C:\Projects\MyApp\MyApp.Mvc\wwwroot\_content\Microsoft.AspNetCore.Components.QuickGrid\QuickGrid.razor.js' ERROR #66134

@argelj289

Description

@argelj289

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

This is an issue that I haven't even seen any solution here than cleaning Nuget package. But still going back to the same issue

What is the actual problem on this?

Can somebody please tell me why this is occuring?

This seems fine when publishing in WASM project but its throwing error when WASM is being published by MVC project

here is the .CSPROJ

MyApp.Mvc.csproj:

<Project Sdk="Microsoft.NET.Sdk.Web">

	<PropertyGroup>
		<TargetFramework>net8.0</TargetFramework>
		<Nullable>enable</Nullable>
		<ImplicitUsings>disable</ImplicitUsings>
	</PropertyGroup>

	<Target Name="BuildAndCopyWasm" BeforeTargets="Build">

		<!-- Publish the WASM project -->
		<Exec Command="dotnet publish ..\MyApp.Wasm\MyApp.Wasm.csproj -c Release" WorkingDirectory="$(ProjectDir)" />

		<!-- Collect published WASM files -->
		<ItemGroup>
			<WasmFiles Include="..\MyApp.Wasm\bin\Release\net8.0\publish\wwwroot\**\*" />
		</ItemGroup>

		<!-- Copy WASM output into MVC wwwroot/app -->
		<Copy SourceFiles="@(WasmFiles)" DestinationFiles="@(WasmFiles->'wwwroot\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />

	</Target>

	<ItemGroup>
	  <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.25" />
	</ItemGroup>

</Project>

MyApp.Wasm.csproj:

<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>disable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Components.QuickGrid" Version="8.0.25" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.25" />
    <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.25" PrivateAssets="all" />
    <PackageReference Include="Microsoft.Extensions.Http" Version="8.0.1" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\MyApp.Lib\MyApp.Lib.csproj" />
  </ItemGroup>

</Project>

ERROR LOG:

Build started at 1:16 PM...
1>------ Build started: Project: MyApp.Mvc, Configuration: Release Any CPU ------
1>C:\Projects\SolarCalculator\MyApp.Mvc\wwwroot_content\Microsoft.AspNetCore.Components.QuickGrid\QuickGrid.razor.js : error BLAZOR106: The JS module file 'C:\Projects\MyApp\MyApp.Mvc\wwwroot_content\Microsoft.AspNetCore.Components.QuickGrid\QuickGrid.razor.js' was defined but no associated razor component or view was found for it.
1>Done building project "MyApp.Mvc.csproj" -- FAILED.
2>------ Skipped Publish: Project MyApp.Mvc, Configuration: Release Any CPU ------
2>
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 1:16 PM and took 00.731 seconds ==========
========== Publish: 0 succeeded, 0 failed, 1 skipped ==========
========== Publish completed at 1:16 PM and took 00.731 seconds ==========

Expected Behavior

Successfully publishing MVC with WASM files included

Steps To Reproduce

  1. Create publish profile of MVC project
  2. Click Publish
  3. Publish failed

Exceptions (if any)

error BLAZOR106: The JS module file 'C:\Projects\MyApp\MyApp.Mvc\wwwroot_content\Microsoft.AspNetCore.Components.QuickGrid\QuickGrid.razor.js' was defined but no associated razor component or view was found for it.

.NET Version

.NET 8

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions