Good day
I am working on a new blazor app, .NET 8 RC 1 and while the app seems to work locally as I am debugging and making changes, this error pops up in the developer tools (browser) console:
What is it, and how do I fix this?
GET https://localhost:7169/_framework/dotnet.js net::ERR_ABORTED 404 (Not Found)
Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: https://localhost:7169/_framework/dotnet.js
I recently encountered the same error and discovered that the cause in my case was related to the ASP.NET Core Server Project. Specifically, the issue was with the following line (Program.cs):
Interestingly, this line is not included in the Blazor Web App Template, which led me to believe that it might no longer be valid.
The error became apparent when I was updating from .NET 7 to .NET 8. Dan Roth, a prominent figure in the .NET community, has also mentioned similar issues when upgrading projects. You can find more details on his GitHub page: Dan Roth's Net8BlazorWebAssembly.
If you're facing similar problems after upgrading, I recommend following Dan Roth's upgrade advice."