-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Append version tag helper does not work for scoped CSS and blazor.webassembly.js #46798
Comments
Thanks for contacting us. It's not clear how the Also, maybe you can try to append |
Hi @rogihee. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
@mkArtakMSFT the issue occurs when a client has a 6.0 runtime / blazor.webassembly.js cached in their browser and the website is upgraded to 7.0, then the loading fails in the boot sequence somewhere with a module error. Stuck at loading screen. I have modified the repro steps. I have a workaround, I created this little version extension:
This uses a verison set globally in the Directory.Build.props, so it is slightly less accurate than a file hash, but will do for my purposes. I use this now in the app.cshtml page:
We'll see if this solves the problem. But this issue confirmed my strong dislike of TagHelpers: it can break without any warning or compile error, and a soft runtime error ("nothing") is a pretty horrible dev/deployment experience. Blazor United FTW! |
Thanks for additional details. We'll wait for you to confirm if that really solved the problem or not. |
Hi @rogihee. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate. See our Issue Management Policies for more information. |
Is there an existing issue for this?
Describe the bug
I have a hosted WASM app in a razor page. The upgrade from dotnet 6.0 to dotnet 7.0 does not work if you have a cached
blazor.webassembly.js
file, the app gets stuck in the loading / boot sequence of blazor.I thought I would use the
asp-append-version
tag helper to fix this in my Razor page where I host the app:After publishing this is rendered to:
I expected something like:
EDIT:
This also applies to the scoped CSS files generated by the SDK:
<link href="MyApp.styles.css" rel="stylesheet" asp-append-version="true" />
Renders to:
<link href="MyApp.styles.css" rel="stylesheet" />
Possibly related to #44216.
Expected Behavior
I expected something like:
Steps To Reproduce
I have to try this with an isolated example, this is basically what happened to us in production.
Exceptions (if any)
No response
.NET Version
9.0
Anything else?
No response
The text was updated successfully, but these errors were encountered: