-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Blazor WebAssembly: Warnings about dotnet.runtime.js and dotnet.native.js version mismatch with dotnet.js after publish #61425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@Solbstr Do you se |
No, I do not see in my project. I am still using UseStaticFiles for serving static content. Regarding the cache: When I enabled "Disable cache" in DevTools -> Network and reloaded the page, the version mismatch warnings disappeared. After disabling "Disable cache" again and reloading the page normally, the warnings remained gone. This confirms that the mismatch warnings were caused by a stale (cached) version of dotnet.js. The application otherwise works correctly, but the warnings only clear when the browser is forced to fetch fresh files. |
@Solbstr Thank you for clarifying that! They way to solve it by using As a workaround the |
Thanks for the follow-up! I’ve now completed the migration to a full Blazor Web App, including configuring The mismatch warnings I originally reported are no longer present — the issue is fully resolved on my end. 🎉 When I first followed the migration guide back in November 2024, some parts of the Appreciate your help and links to the official guidance! |
@Solbstr Awesome. Thank you for confirmation! I'm going to close the issue now. Feel free to reach back. |
Hi @maraf, I’ve noticed that once fingerprinting is enabled, my app.min.css styles disappear on hot-reload in development and only reappear after I do a full page refresh. Do you know how I can preserve the styles without hitting F5? |
@Solbstr Sorry for late reply. In case it persists, especially if you are able to identify reproducible steps, please open a separate issue. |
Is there an existing issue for this?
Describe the bug
After publishing a new version of a Blazor WebAssembly Hosted app (example: .NET 9.0.3 → 9.0.4), the browser console shows persistent mismatch warnings:
dotnet.runtime.qrl1fuqt3c.js:3 MONO_WASM: The version of dotnet.runtime.js 831d23e56149cd59c40fc00c7feb7c5334bd19c4 is different from the version of dotnet.js 80aa709f5d919c6814726788dc6dabe23e79e672!
dotnet.runtime.qrl1fuqt3c.js:3 MONO_WASM: The version of dotnet.native.js 831d23e56149cd59c40fc00c7feb7c5334bd19c4 is different from the version of dotnet.js 80aa709f5d919c6814726788dc6dabe23e79e672!
Even though the warnings appear, the application continues to function normally.
The root cause seems to be that
dotnet.js
is not fingerprinted during publish, so browsers aggressively cache an outdated version across deployments.This mismatch does not immediately break the app, but could cause issues with larger version upgrades in the future.
Expected Behavior
There should be no version mismatch warnings in the browser console after publishing a new version.
Ideally,
dotnet.js
should be fingerprinted (e.g.,/dotnet.[hash].js
) during publish, just likedotnet.runtime.js
anddotnet.native.js
are.This would prevent caching issues and ensure version consistency.
Steps To Reproduce
Exceptions (if any)
No unhandled exceptions.
Only console warnings are shown.
Application still runs successfully.
.NET Version
9.0.201
Anything else?
Suggestion: Please fingerprint
dotnet.js
during publish, similar to other WebAssembly runtime assets.Alternatively, provide a built-in cache-busting mechanism for critical runtime files at startup.
This would avoid unnecessary confusion for developers and prevent potential app breakage in future upgrades.
Tested on:
The text was updated successfully, but these errors were encountered: