dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.47k stars 10.03k forks source link

Microsoft.AspNetCore.Components.QuickGrid fails with "BLAZOR106: The JS module file wwwroot/_content/Microsoft.AspNetCore.Components.QuickGrid/QuickGrid.razor.js' was defined but no associated razor component or view was found for it." #54644

Closed SeppPenner closed 7 months ago

SeppPenner commented 7 months ago

Is there an existing issue for this?

Describe the bug

Adding the quick grid to a Net8.0 project breaks the build / publish process from the console with the following error:

/builds/MyServer/publish/wwwroot/_content/Microsoft.AspNetCore.Components.QuickGrid/QuickGrid.razor.js :
error BLAZOR106: The JS module file '/builds/MyServer/publish/wwwroot/_content/Microsoft.AspNetCore.Components.QuickGrid/QuickGrid.razor.js'
was defined but no associated razor component or view was found for it. [/builds/MyServer/MyServer.csproj]

Publish: dotnet publish --configuration Release -r win-x64 --no-self-contained --no-restore --output publish.win-x64/

Expected Behavior

Build works without errors.

Steps To Reproduce

Create a dummy Net8 project and add the Microsoft.AspNetCore.Components.QuickGrid package from NuGet, add it to a dummy page.

Exceptions (if any)

/builds/MyServer/publish/wwwroot/_content/Microsoft.AspNetCore.Components.QuickGrid/QuickGrid.razor.js :
error BLAZOR106: The JS module file '/builds/MyServer/publish/wwwroot/_content/Microsoft.AspNetCore.Components.QuickGrid/QuickGrid.razor.js'
was defined but no associated razor component or view was found for it. [/builds/MyServer/MyServer.csproj]

.NET Version

8.0.202

Anything else?

$ dotnet --info
.NET SDK:
 Version:           8.0.202
 Commit:            25674bb2f4
 Workload version:  8.0.200-manifests.4e94be9c
Runtime Environment:
 OS Name:     debian
 OS Version:  12
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/8.0.202/
.NET workloads installed:
There are no installed workloads to display.
Host:
  Version:      8.0.3
  Architecture: x64
  Commit:       9f4b1f5d66
.NET SDKs installed:
  8.0.202 [/usr/share/dotnet/sdk]
.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
  None
Environment variables:
  Not set
global.json file:
  Not found
Learn more:
  https://aka.ms/dotnet/info
Download .NET:
  https://aka.ms/dotnet/download
SeppPenner commented 7 months ago

Minimal repro project is under https://github.com/SeppPenner/QuickGridTest. I added the build image we use in our Gitlab CI pipeline as well under https://github.com/SeppPenner/QuickGridTest/tree/master/src/docker-buildimage (And pushed it fresh to dockerhub with my username as well).

The thing is that this now works with the minimal repro... Do you have any ideas where this issue might come from?

mkArtakMSFT commented 7 months ago

The thing is that this now works with the minimal repro...

Thanks for contacting us. It's not clear if the issue still relevant then. Are you still facing this issue, or not?

SeppPenner commented 7 months ago

The thing is that this now works with the minimal repro...

Thanks for contacting us. It's not clear if the issue still relevant then. Are you still facing this issue, or not?

I'm still facing the issue within our build pipeline, but I sadly couldn't reproduce it within the minimal working example...

mkArtakMSFT commented 7 months ago

Unfortunately, we won't be able to investigate this without a repro. I'm going to close this issue and hopefully you will be able to reproduce the issue and give us a repro later. Ideally, of course, you will find the culprit in your pipeline / code and fix it yourself. Once you have a repro, please file a new issue.

SeppPenner commented 7 months ago

Unfortunately, we won't be able to investigate this without a repro. I'm going to close this issue and hopefully you will be able to reproduce the issue and give us a repro later. Ideally, of course, you will find the culprit in your pipeline / code and fix it yourself. Once you have a repro, please file a new issue.

Do you by any chance have some ideas where I should look at? E.g. some logs or whatever?

mdmontesinos commented 7 months ago

I'm also getting the same error when trying to extract the staticwebassets from the NuGet package and manually adding them to my project (as is required because I'm using Oqtane).

AndreiShenets commented 5 months ago

The issue still happens for me as well. After some successful builds it starts to fail.

As a work around it helps to delete bin and obj folders, then restore nuget packages and build again.