question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MacOS published releases are broken

See original GitHub issue

Bug type

Other

Component name

No response

What happened?

Published applications using dotnet publish on MacOS (or, specifically M1 systems) are broken.

CleanShot 2023-04-22 at 11 52 18@2x

Expected behavior

The page should render as normal.

Reproduction link

This is reproducable on the default template

Reproduction steps

  1. Run dotnet new mudblazor --host server --name MudblazorTest
  2. Run dotnet publish -c Release on MacOS (tested on M1 Pro)
  3. Open the created executable
  4. View the logs in the console, view broken render, etc.

Relevant log output

/Users/stage/Documents/github/MudblazorTest/bin/Release/net6.0/publish/MudblazorTest; exit
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[62]
      User profile is available. Using '/Users/stage/.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
      Content root path: /Users/stage/
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET http://localhost:5000/ - -
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/1.1 GET http://localhost:5000/ - - - 307 0 - 4.2169ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET https://localhost:5001/ - -
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
      Executing endpoint '/_Host'
info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[3]
      Route matched with {page = "/_Host"}. Executing page /_Host
info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[107]
      Executing an implicit handler method - ModelState is Valid
info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[109]
      Executed an implicit handler method, returned result Microsoft.AspNetCore.Mvc.RazorPages.PageResult.
info: Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker[4]
      Executed page /_Host in 115.822ms
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
      Executed endpoint '/_Host'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/1.1 GET https://localhost:5001/ - - - 200 - text/html;+charset=utf-8 140.7152ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET https://localhost:5001/_content/MudBlazor/MudBlazor.min.css - -
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/1.1 GET https://localhost:5001/_content/MudBlazor/MudBlazor.min.css - - - 404 0 - 0.9941ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET https://localhost:5001/_framework/blazor.server.js - -
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET https://localhost:5001/_content/MudBlazor/MudBlazor.min.js - -
info: Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware[2]
      Sending file. Request path: '/_framework/blazor.server.js'. Physical path: 'N/A'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/1.1 GET https://localhost:5001/_framework/blazor.server.js - - - 200 131695 application/javascript 7.2204ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/1.1 GET https://localhost:5001/_content/MudBlazor/MudBlazor.min.js - - - 404 0 - 0.6107ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET https://localhost:5001/_content/MudBlazor/MudBlazor.min.css - -
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/1.1 GET https://localhost:5001/_content/MudBlazor/MudBlazor.min.css - - - 404 0 - 0.1259ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET https://localhost:5001/_content/MudBlazor/MudBlazor.min.js - -
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET https://localhost:5001/_blazor/initializers - -
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/1.1 GET https://localhost:5001/_content/MudBlazor/MudBlazor.min.js - - - 404 0 - 0.1152ms
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
      Executing endpoint 'Blazor initializers'
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
      Executed endpoint 'Blazor initializers'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/1.1 GET https://localhost:5001/_blazor/initializers - - - 200 - application/json;+charset=utf-8 1.5570ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET https://localhost:5001/favicon.ico - -
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/1.1 GET https://localhost:5001/favicon.ico - - - 404 0 - 4.1145ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 POST https://localhost:5001/_blazor/negotiate?negotiateVersion=1 text/plain;charset=UTF-8 0
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
      Executing endpoint '/_blazor/negotiate'
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
      Executed endpoint '/_blazor/negotiate'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/1.1 POST https://localhost:5001/_blazor/negotiate?negotiateVersion=1 text/plain;charset=UTF-8 0 - 200 316 application/json 6.9300ms
info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/1.1 GET https://localhost:5001/_blazor?id=UEjXONNqroieXA1SOAyj0Q - -
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
      Executing endpoint '/_blazor'
warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
      Unhandled exception rendering component: Could not find 'mudElementRef.getBoundingClientRect' ('mudElementRef' was undefined).
      findFunction/<@https://localhost:5001/_framework/blazor.server.js:1:497
      findFunction@https://localhost:5001/_framework/blazor.server.js:1:465
      E@https://localhost:5001/_framework/blazor.server.js:1:2606
      beginInvokeJSFromDotNet/s<@https://localhost:5001/_framework/blazor.server.js:1:3494
      beginInvokeJSFromDotNet@https://localhost:5001/_framework/blazor.server.js:1:3475
      _invokeClientMethod/<@https://localhost:5001/_framework/blazor.server.js:1:72061
      _invokeClientMethod@https://localhost:5001/_framework/blazor.server.js:1:72047
      _processIncomingData@https://localhost:5001/_framework/blazor.server.js:1:70089
      kt/this.connection.onreceive@https://localhost:5001/_framework/blazor.server.js:1:64492
      connect/</o.onmessage@https://localhost:5001/_framework/blazor.server.js:1:48826

      Microsoft.JSInterop.JSException: Could not find 'mudElementRef.getBoundingClientRect' ('mudElementRef' was undefined).
      findFunction/<@https://localhost:5001/_framework/blazor.server.js:1:497
      findFunction@https://localhost:5001/_framework/blazor.server.js:1:465
      E@https://localhost:5001/_framework/blazor.server.js:1:2606
      beginInvokeJSFromDotNet/s<@https://localhost:5001/_framework/blazor.server.js:1:3494
      beginInvokeJSFromDotNet@https://localhost:5001/_framework/blazor.server.js:1:3475
      _invokeClientMethod/<@https://localhost:5001/_framework/blazor.server.js:1:72061
      _invokeClientMethod@https://localhost:5001/_framework/blazor.server.js:1:72047
      _processIncomingData@https://localhost:5001/_framework/blazor.server.js:1:70089
      kt/this.connection.onreceive@https://localhost:5001/_framework/blazor.server.js:1:64492
      connect/</o.onmessage@https://localhost:5001/_framework/blazor.server.js:1:48826

         at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
         at MudBlazor.MudDrawer.UpdateHeight()
         at MudBlazor.MudDrawer.OnAfterRenderAsync(Boolean firstRender)
         at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]
      Unhandled exception in circuit 'AMroAoBmtD2bEMUzdyW_jSJX27g7kWqq5krMKtnmPhY'.
      Microsoft.JSInterop.JSException: Could not find 'mudElementRef.getBoundingClientRect' ('mudElementRef' was undefined).
      findFunction/<@https://localhost:5001/_framework/blazor.server.js:1:497
      findFunction@https://localhost:5001/_framework/blazor.server.js:1:465
      E@https://localhost:5001/_framework/blazor.server.js:1:2606
      beginInvokeJSFromDotNet/s<@https://localhost:5001/_framework/blazor.server.js:1:3494
      beginInvokeJSFromDotNet@https://localhost:5001/_framework/blazor.server.js:1:3475
      _invokeClientMethod/<@https://localhost:5001/_framework/blazor.server.js:1:72061
      _invokeClientMethod@https://localhost:5001/_framework/blazor.server.js:1:72047
      _processIncomingData@https://localhost:5001/_framework/blazor.server.js:1:70089
      kt/this.connection.onreceive@https://localhost:5001/_framework/blazor.server.js:1:64492
      connect/</o.onmessage@https://localhost:5001/_framework/blazor.server.js:1:48826

         at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
         at MudBlazor.MudDrawer.UpdateHeight()
         at MudBlazor.MudDrawer.OnAfterRenderAsync(Boolean firstRender)
         at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
      Executed endpoint '/_blazor'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/1.1 GET https://localhost:5001/_blazor?id=UEjXONNqroieXA1SOAyj0Q - - - 101 - - 84.6108ms

Version (bug)

6.2.2

Version (working)

No response

What browsers are you seeing the problem on?

Firefox, Safari

On what operating system are you experiencing the issue?

Mac OSX

Pull Request

  • I would like to do a Pull Request

Code of Conduct

  • I agree to follow this project’s Code of Conduct

Issue Analytics

  • State:closed
  • Created 5 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ScarletKurocommented, Apr 24, 2023

I’m going to close this issue now that I understand that the initial problem has been resolved. Please let me know if you require any further assistance.

0reactions
hburn7commented, Apr 23, 2023

Thank you for these suggestions. I found that this specific comment fixed my issue. Going to test on Windows now, but this fixed the MacOS issue I was having.

https://github.com/dotnet/aspnetcore/issues/38212#issuecomment-1094357982

Read more comments on GitHub >

github_iconTop Results From Across the Web

Open a Mac app from an unidentified developer
However, the app has not been reviewed, and macOS can't check whether the app has been modified or broken since it was released....
Read more >
[Updated] macOS Big Sur update broke printing function on ...
The macOS Big Sur update seems to have broken the printing function on Mac computers. Here are some workarounds that might fix the...
Read more >
Apple fixes latest security update that broke several ...
Apple fixes latest security update that broke several popular apps. Apple has released a (c) version of this week's Rapid Security Response ...
Read more >
Apple Pulls iOS 16.5.1 and macOS 13.4.1 Rapid Security ...
Apple will likely re-release the RSRs when the issue has been addressed. Apple has pulled the Rapid Security Responses released earlier today.
Read more >
Captivate Publishing Broken under OS X High Sierra
Hey everyone, I posted this in reply to someone asking if Captivate was compatible with High Sierra but I thought I'd pose it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found