OpenBullet2 icon indicating copy to clipboard operation
OpenBullet2 copied to clipboard

[Bug]: .NET Core Update Broke OpenBullet2

Open vurezo opened this issue 3 years ago • 6 comments

Version of the software

0.2.4

Operating system

Windows 11 & Debian

Browser / Native

Chrome 104

What happened?

After some .NET runtime update, the next time I launched it, it started up like first time install, all the CSS is missing and it's just a broken looking page, my jobs, hits, everything looks to be gone, console is full of errors.

fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111] Unhandled exception in circuit '8pRJhZQtNVUtdh9khp-qsF1tsSlvJiPvZUIM05Hu2kQ'. Microsoft.JSInterop.JSException: Could not find 'registerNavMenu' ('registerNavMenu' was undefined). Error: Could not find 'registerNavMenu' ('registerNavMenu' was undefined). at http://localhost:5000/_framework/blazor.server.js:1:497 at Array.forEach (<anonymous>) at i.findFunction (http://localhost:5000/_framework/blazor.server.js:1:465) at E (http://localhost:5000/_framework/blazor.server.js:1:2606) at http://localhost:5000/_framework/blazor.server.js:1:3494 at new Promise (<anonymous>) at kt.beginInvokeJSFromDotNet (http://localhost:5000/_framework/blazor.server.js:1:3475) at http://localhost:5000/_framework/blazor.server.js:1:72061 at Array.forEach (<anonymous>) at kt._invokeClientMethod (http://localhost:5000/_framework/blazor.server.js:1:72047) at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args) at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args) at OpenBullet2.Shared.NavMenu.OnInitializedAsync() in /mnt/d/Documents/OpenBullet2/OpenBullet2/Shared/NavMenu.razor:line 211 at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState) warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100] Unhandled exception rendering component: Could not find 'registerNavMenu' ('registerNavMenu' was undefined). Error: Could not find 'registerNavMenu' ('registerNavMenu' was undefined). at http://localhost:5000/_framework/blazor.server.js:1:497 at Array.forEach (<anonymous>) at i.findFunction (http://localhost:5000/_framework/blazor.server.js:1:465) at E (http://localhost:5000/_framework/blazor.server.js:1:2606) at http://localhost:5000/_framework/blazor.server.js:1:3494 at new Promise (<anonymous>) at kt.beginInvokeJSFromDotNet (http://localhost:5000/_framework/blazor.server.js:1:3475) at http://localhost:5000/_framework/blazor.server.js:1:72061 at Array.forEach (<anonymous>) at kt._invokeClientMethod (http://localhost:5000/_framework/blazor.server.js:1:72047) Microsoft.JSInterop.JSException: Could not find 'registerNavMenu' ('registerNavMenu' was undefined). Error: Could not find 'registerNavMenu' ('registerNavMenu' was undefined). at http://localhost:5000/_framework/blazor.server.js:1:497 at Array.forEach (<anonymous>) at i.findFunction (http://localhost:5000/_framework/blazor.server.js:1:465) at E (http://localhost:5000/_framework/blazor.server.js:1:2606) at http://localhost:5000/_framework/blazor.server.js:1:3494 at new Promise (<anonymous>) at kt.beginInvokeJSFromDotNet (http://localhost:5000/_framework/blazor.server.js:1:3475) at http://localhost:5000/_framework/blazor.server.js:1:72061 at Array.forEach (<anonymous>) at kt._invokeClientMethod (http://localhost:5000/_framework/blazor.server.js:1:72047) at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args) at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args) at OpenBullet2.Shared.NavMenu.OnInitializedAsync() in /mnt/d/Documents/OpenBullet2/OpenBullet2/Shared/NavMenu.razor:line 211 at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

Issue persists after re-compiling both on Debian and Windows 11.

Perhaps there is a solution to downgrade .NET or something? I forgot what it was that caused it but something updated recently within the last week or two.

Relevant LoliCode if needed

No response

vurezo avatar Aug 18 '22 11:08 vurezo

Where is the database file stored ?

vurezo avatar Aug 18 '22 12:08 vurezo

database is empty my god

vurezo avatar Aug 18 '22 12:08 vurezo

Hello, did you use the build or the publish command? Being an ASP.NET core app you need to use dotnet publish, otherwise it will not include the resources such css and js files.

openbullet avatar Aug 18 '22 21:08 openbullet

As for the DB being empty, did you check the UserData folder under the bin/Release and bin/Debug folders?

openbullet avatar Aug 18 '22 21:08 openbullet

bin/Release, and I only ever did the publish command

vurezo avatar Aug 20 '22 17:08 vurezo

Any chance you could remove dotnet entirely and start from scratch by downloading the whole .NET 6 SDK and clone the repo in a new clean folder?

openbullet avatar Aug 20 '22 19:08 openbullet

If you use the dotnet publish -c Release command, you need to use the build under bin/Release/publish.

openbullet avatar Jun 06 '24 21:06 openbullet