aspnetcore: Blazor: Updating from 8.0.4 to 8.0.5 silently crashed our webapp due to caching of dotnet.js

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

We have a Blazor application that we are building with the docker image of the SDK targetting 8.0 This caused the docker image to silently change from 8.0.4 to 8.0.5 and our application stopped working unexpectedly, with console errors.

Upon further inspection we found out about the change.

dotnet.native.8.0.4.uy5lxmc247.js dotnet.runtime.8.0.4.riehddozk1.js

Were changed to:

dotnet.native.8.0.5.noy87qpmp4.js dotnet.runtime.8.0.5.s4tpo9pkiw.js

Which is fine. However the dotnet.js file was also changed, but due to lacking versioning and a hash, the browser still loaded the previously cached version and it would break the web application until we clear cache and allow for the new dotnet.js to load.

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

MONO_WASM: TypeError: Cannot read properties of undefined (reading 'out')
    at $l (https://staging.sbxcars.com/_framework/dotnet.runtime.8.0.5.s4tpo9pkiw.js:3:198913)
    at ze (https://staging.sbxcars.com/_framework/dotnet.js:3:30895)
    at https://staging.sbxcars.com/_framework/dotnet.js:3:30131
    at async Object.create (https://staging.sbxcars.com/_framework/dotnet.js:3:34510)
    at async https://staging.sbxcars.com/_framework/blazor.webassembly.js:1:43178
    at async https://staging.sbxcars.com/_framework/blazor.webassembly.js:1:57722
    at async hn (https://staging.sbxcars.com/_framework/blazor.webassembly.js:1:57325)
u @ dotnet.js:3
dotnet.js:3 Error in mono_download_assets: TypeError: Cannot read properties of undefined (reading 'out')
Q @ dotnet.js:3
10dotnet.runtime.8.0.5.s4tpo9pkiw.js:3 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'out')
    at $l (dotnet.runtime.8.0.5.s4tpo9pkiw.js:3:198913)
    at ze (dotnet.js:3:30895)
    at dotnet.js:3:30131
    at async Object.create (dotnet.js:3:34510)
    at async blazor.webassembly.js:1:43178
    at async blazor.webassembly.js:1:57722
    at async hn (blazor.webassembly.js:1:57325)
blazor.webassembly.js:1 Uncaught (in promise) Error: Failed to start platform. Reason: TypeError: Cannot read properties of undefined (reading 'out')
    at hn (blazor.webassembly.js:1:57366)

.NET Version

8.0.5

Anything else?

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 16 (6 by maintainers)

Most upvoted comments

I ran into this with my ASP.NET Core hosted Blazor WASM site, and clearing browser cache does not work in this situation. I had to fully scorch all bin/obj folders and redeploy.

https://github.com/dotnet/aspnetcore/issues/55978 Is there any workaround without having all end users do a hard refresh? This is a pretty nasty bug for apps having alot of users…

Edit: @maraf workaround above worked for us 👍

We are experiencing this issue in our production environment (WASM app using Docker) where there is a mismatch in versions (8.0.4 to 8.0.5). Attempts to pin to a specific version were not successful.

Hard refreshing sometimes resolves the issue, but not always.

@ipax77 Could you share what your csproj looks like (I’m investigating what is the cause)?

Here is my client project file: dsstats.web.Client.csproj

Yup. I got this immediately after installing VS 17.9.7 and updating packages to 8.0.5.

Solution for me was to clear brower’s cache of web content. Possibly a hard refresh could have done it.

Happened to me on Chrome, Edge and FF and on two different Windows 10 machines.

I have had to instruct my (internal) users to clear cache similarly. We don’t use Blazor WebAssembly for public-facing websites, only internal tools.