aspnetcore: [Blazor WASM] Upgrading project to .NET 8.0.10 breaks WASM
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Upon upgrading a Blazor WASM Standalone .NET 8 project to 8.0.10 (including all related NuGet packages), Debugging on Visual Studio 2022 17.11.5 or navigating to a Deployed site with previous version cache breaks during runtime with the following:
MONO_WASM: The version of dotnet.runtime.js is different from the version of dotnet.js!
MONO_WASM: The version of dotnet.native.js is different from the version of dotnet.js!
MONO_WASM: mono_wasm_load_runtime () failed TypeError: u.isDebuggingSupported is not a function
at Vl (c:\Users\<PATH_TO_SOLUTION>\_framework\https:\raw.githubusercontent.com\dotnet\runtime\81cabf2857a01351e5ab578947c7403a5b128ad1\src\mono\wasm\runtime\startup.ts:575:28)
at c:\Users\<PATH_TO_SOLUTION>\_framework\https:\raw.githubusercontent.com\dotnet\runtime\81cabf2857a01351e5ab578947c7403a5b128ad1\src\mono\wasm\runtime\startup.ts:551:5
at https://localhost:7112/_framework/dotnet.runtime.8.0.10.39apnb5yx8.js:3:207329 {stack: 'TypeError: u.isDebuggingSupported is not a fu…/dotnet.runtime.8.0.10.39apnb5yx8.js:3:207329', message: 'u.isDebuggingSupported is not a function'}
MONO_WASM: TypeError: u.isDebuggingSupported is not a function
at Vl (https://localhost:7112/_framework/dotnet.runtime.8.0.10.39apnb5yx8.js:3:217167)
at https://localhost:7112/_framework/dotnet.runtime.8.0.10.39apnb5yx8.js:3:206677
at https://localhost:7112/_framework/dotnet.runtime.8.0.10.39apnb5yx8.js:3:207329
TypeError: u.isDebuggingSupported is not a function
Stack trace:
> at Vl (https://localhost:7112/_framework/dotnet.runtime.8.0.10.39apnb5yx8.js:3:217167)
> at https://localhost:7112/_framework/dotnet.runtime.8.0.10.39apnb5yx8.js:3:206677
> at https://localhost:7112/_framework/dotnet.runtime.8.0.10.39apnb5yx8.js:3:207329
Previous issues related to that version difference message recommended clearing out all bin and obj folder – which I have tried with no success.
One of our users reported the same errors on their Chrome / Edge console, for which clearing out their browser cache made it work. It seems that there might be some sort of incompatibility somewhere that “breaks” instead of “upgrading” the .NET libraries – so it looks like the issue comes from the moving from one version to the next, not 8.0.10 by itself.
If this is the case, where just by navigating to the site without a “clean cache” it breaks, then it’s a bigger regression than I expected. Hopefully it’s not!
Thanks for your time.
Expected Behavior
On VS 2022, debugging should just work flawlessly. On deployed site, users should NOT be expected to clear their cache to navigate to the site.
Steps To Reproduce
From a Standalone Blazor WASM project starting on 8.0.8, compile and debug. Then, upgrade to 8.0.10 and try again.
On a deployed site, deploy the 8.0.8 version and navigate to it. Then, deploy the 8.0.10 version and with the same browser with the site cached, navigate to the site.
Exceptions (if any)
Clearing cache, or navigating with a “fresh” browser works fine.
.NET Version
8.0.403
Anything else?
.NET 8.0.10 / 8.0.403 Visual Studio 2022 17.11.5
dotnet --info:
.NET SDK:
Version: 8.0.403
Commit: c64aa40a71
Workload version: 8.0.400-manifests.e99c892e
MSBuild version: 17.11.9+a69bbaaf5
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 31
- Comments: 68 (3 by maintainers)
Commits related to this issue
- Update wasm-prd.yml https://github.com/dotnet/aspnetcore/issues/58313 — committed to masastack/MASA.Blazor by capdiem 2 years ago
- change default port to fix .net upgrade bugs: https://github.com/dotnet/aspnetcore/issues/58313 — committed to bodong1987/Avalonia.PropertyGrid by bodong1987 2 years ago
@mkArtakMSFT I am sorry, but I don’t think this can wait until .NET 10 planning. This really needs to be fixed ASAP or at least Blazor developers need to have some sure-fire cache-busting hints to work around it. Website users should not need to know that in order to avoid a blank screen, it’s essential to Ctrl+Refresh their browser.
It would be useful if, when these MONO_WASM errors occur, one of the JavaScript scripts could write to the screen, explaining to the user what they need to do (i.e. hard refresh their browser)
These sort of issues pop up regularly. It’s not just with the latest version of .NET 8. It’s frustrating and embarassing and wastes a lot of time explaining this stuff to customers.
Hi everyone, experienced the same issue. As a workaround, the only thing that fixed it for me was specifying the runtime explicitely to a version older than 8.0.10. Add
<RuntimeFrameworkVersion>8.0.8</RuntimeFrameworkVersion>in your csproj file and (at least for me) everything works fine. Microsoft should deliver a fix for that.Broke on production, all devices and all browsers. Not related to cache
Fixed by adding:
<RuntimeFrameworkVersion>8.0.8</RuntimeFrameworkVersion>In the .Client project
Damn straight! Our CTO took the executive decision in May 2020 - when I adopted Blazor WebAssembly - to restrict it to internal tools, and to never allow it for our public-facing web apps. What a wise decision that was, given this and related issues.
Telling my internal users to Ctrl+F5 (or hard refresh by some other means) just because the framework version got updated is embarrassing enough.
More awful on a day-to-day basis is the failure to launch VS 2022 Pro to debug my web app - just because the framework version changed. Today I wasted hours of my life after upgrading my .NET 8 solution to 9:- endless errors relating to failing to load obscure files like “promise-controller.ts” etc after hitting F5. When I finally got .NET 9 to work with VS 2022 + Edge, I decided to go back to .NET 8… and spent more hours fighting to make that work! This really shouldn’t be happening.
I never had a problem with Blazor WebAssembly prior to .NET 8 - except for the Razor editor being a bit rubbish. That’s improved, but can still really annoy you by doing really dumb stuff.
The fact that problems large and small appeared on the release of .NET 8 (or soon after) and still aren’t resolved today (over a year later, and with the release of .NET 9) is extremely concerning.
At this time, I worry whether these problems will even be resolved by the time of .NET 10 release. For this reason, I’m wouldn’t recommend Blazor WebAssembly to any new adopter. But I don’t need to worry about there being new adopters, as Microsoft went and made it very difficult for anyone new adopting it by:-
I love Blazor WebAssembly, but I’m concerned for its future for all of these reasons and more.
If you are using asp.core for hosting Blazor Web Assembly, then you can use this code in program.cs asp. core project:
In this case all responses from server will be reloaded. But it must be used only with parameters, first time load after update for user.
Dear AspNetCore team, I have experienced the same issue.
After inserting the line indicated in the following image into the Client project’s csproj file, the error disappeared on my side (as a temporary solution).
.NET 10 Planning??? So more than 1 year to have this fixed!
I have a lot of people all around the world stuck in the load screen just because i’ve updated the framework This is not acceptable.
This issue is going on from past 2+ months and not one from Microsoft is responding on this …
Javier Calvarro Nelson - Since this issue is assignee to you, do you have any SLA to get it resolved and if you could not resolve it the ESCALATE this to higher management.
Do we have to write to Satya Nadela then Microsoft team would respond on this ? Atleast keep all the stakeholders UPDATED with latest what is going on to get this issue RESOLVED.
submitted a question to Microsoft as well which they declared duplicate with existing one -
https://developercommunity.visualstudio.com/t/net-80-Blazor-web-application-dependen/10796757
Similar way @Artak Mkrtchyan [MSFT] declared above mentioned issue as duplicate and after that no update. WHY microsoft team is NOT responding ? WHY you guys keeping silent on this? Can you redirect us to your Manager or schedule a CALL to discuss on this. Please understand the INTENCITY of this issue impacting thousand of users by now.
https://github.com/github Team - This is still UNRESOLVED. Please provide a solution.
I have exactly the same issue after upgrading my Blazor WASM app from .NET 8 to .NET 9. My JS console shows the exact same messages. This is quite a critical issue IMO. All users that previously visited my app now get greeted with an error and it results in the app getting stuck loading:
An unhandled error has occurred. [Reload]If the user clicks the button to (hard) refresh the page it works again, so it’s not a persistent issue. But in my opinion this is very bad user experience for an out-of-the-box configuration of Blazor WASM.
I’m seeing the same issue since upping my Blazor WASM web app to .NET 8.0.10.
Local development works fine – it only happens for me in Production (which deploys via a GitHub Actions process that pulls the repo into a fresh container, builds from scratch, and publishes).
I’ve had to roll back to 8.0.8 for now.
I was not able to downgrade or throwing the 8.0.10 js framework references completely out of my build pipeline.
So I did this hack and it solved the issues at customers side (in index.html or some startup js file):
Also experiencing this issue. I can also verify that the issue is NOT cache related. We were already setting the cache header of all .js files to
no-cacheprior to experiencing this issue and clearing the cache completely does not make the error go away.We were able to fix the error by reverting back all the NuGet packages to version
8.0.8and adding the<RuntimeFrameworkVersion>8.0.8</RuntimeFrameworkVersion>element to the .Client project.I don’t believe this is a cache issue. I’ve purged the cache, hard reloaded, tried on different machines and that doesn’t fix the issue.
@ElliottBrand Implementing the cache buster on blazor.web.js doesn’t work for me, as the problem is caused by the loading of an old cached version of dotnet.js.
@kir0riwal Here’s my app.razor file: App.razor.txt My project is built from the newer “Blazor Web App” project template, so it uses “_framework/blazor.web.js” (instead of “_framework/blazor.webassembly.js”).
Same issue here. Also appears not to be a cache issue. No amount of cache busting / clearing my cache etc could resolve this - only reverting to an older runtime framework version, as others have pointed out above.
Hi everybody. I did everything that was said and done here, but it still didn’t work. Downgrading to Visual Studio 2022 17.11.4 fixed the problem. My project structure is App.Server and App.Client(BlazorWebAssembly) netsdk 8.0.400 and dll references are 8.0.10, but when I downgrade, debug works. The problem seems to be caused by Visual Studio. I hope they fix it in the next patch.
I have the same issue. But I think it is related to the update to Visual Studio 2022 17.11.5!
@omni-htg you can try adding a
Cache: no-cacheto the response for the JS files or do a hard refresh to see if the issue goes away.We are no longer able to reproduce this issue, though likely this is due to all existing caches expiring. We set the cache control header on all outgoing static file middleware served files to no-cache. This is slightly less efficient, but the extra 302 request/response overhead is acceptable as our application is not extremely high volume and there doesn’t exist an automatic file hashing mechanism for js modules loaded at runtime (such a mechanism would likely need a source generator to read the content of bundled js modules, compute a hash, and inject the hash into the file name we pass to the JS interop when loading modules - not something in scope for this project).
I believe this issue is resolved by one of these two approaches (or both).
Blazor WebAssembly Example:
<script src="_framework/blazor.webassembly.js?cb=123456"></script>Blazor Server Example:
<script src="/_framework/blazor.server.js?cb=123456"></script>Blazor (the newer approach in App.razor) Example:
<script src="_framework/blazor.web.js?cb=123456"></script>If implementing a cache buster approach like this, you just need to decide how you want to render the unique string in the query parameter. You could simply update it manually with every release, but you’ll probably want to do it programmatically. You’ll need to decide what works best for your application. Some people set it by their app version (when the app is versioned), some set it by DateTime Ticks, etc.
You could try another solution: Might not work if files are already cached. Add this code before app.UseRouting()
Here’s a workaround that worked for me:
Has anyone resolved the .NET9 upgrade issue (as many have noted above), or are we patiently waiting for 9.0.1 runtime release?
It was simple as commenting out this line
#RUN dotnet workload install wasm-toolsin our Dockerfile.It’s an optional step, and you might lose some app optimizations, but at least it works, lol.
After deployment, you can verify the runtime version in browser devtools -> Sources -> _framework ->
dotnet.runtime.8.0.8.9z6kkxsnez.jspls fix
Meanwhile, as a temporary work-around to prevent users having to hard refresh our deployed standalone WASM app, we did the following:
mcr.microsoft.com/dotnet/sdk:8.0.402wasm-toolsworkload, as it seems to pull-in the latest run-timeStarted to face exact same issue after upgrade of visual studio to latest version.
After reading all this thread i was wondering how may such posts should be enough for micrsoft bros to take this stuff serious.
I also ran into issues after upgrading Visual Studio / .Net and saw the same errors about
u.IsDebuggingSupportedfor the WASM client. After clearing all caches didn’t work, I deleted all theobjandbinfolders, then redeployed and that resolved it.I did a small text/content update to my website which. My pipeline uses “https://dot.net/v1/dotnet-install.sh” to install .NET 8.0 so it presumably downloaded the latest version so I got this error. I’ve rolled back to an August build of the site to fix the issue.
I’m using the SDK Version 8.0.403 now and my app works with packages 8.0.8 and 8.0.10.