Skip to content
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

[HxTooltip] JS error when bootstrap is not loaded #677

Open
sebastianbk opened this issue Nov 28, 2023 · 1 comment · May be fixed by #678
Open

[HxTooltip] JS error when bootstrap is not loaded #677

sebastianbk opened this issue Nov 28, 2023 · 1 comment · May be fixed by #678
Assignees

Comments

@sebastianbk
Copy link

I believe there's a race condition that causes HxTooltip to throw an exception intermittently.

See the following stack trace:

[2023-11-28T14:29:23.368Z] Error: Microsoft.JSInterop.JSException: bootstrap is not defined
ReferenceError: bootstrap is not defined
    at Module.initialize (https://app.heyhack.com/_content/Havit.Blazor.Components.Web.Bootstrap/HxTooltip.js?v=2.0.0%2Ba8df7d1f865fa0872d8fdb75e7d97838d252495f:9:2)
    at https://app.heyhack.com/_framework/blazor.server.js:1:3244
    at new Promise (<anonymous>)
    at y.beginInvokeJSFromDotNet (https://app.heyhack.com/_framework/blazor.server.js:1:3201)
    at Yt._invokeClientMethod (https://app.heyhack.com/_framework/blazor.server.js:1:60713)
    at Yt._processIncomingData (https://app.heyhack.com/_framework/blazor.server.js:1:58188)
    at Yt.connection.onreceive (https://app.heyhack.com/_framework/blazor.server.js:1:51829)
    at s.onmessage (https://app.heyhack.com/_framework/blazor.server.js:1:79974)
   at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
   at Microsoft.JSInterop.JSObjectReferenceExtensions.InvokeVoidAsync(IJSObjectReference jsObjectReference, String identifier, Object[] args)
   at Havit.Blazor.Components.Web.Bootstrap.Internal.HxTooltipInternalBase.OnAfterRenderAsync(Boolean firstRender)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

I have made a fix that prevents this exception from being thrown. I will submit a pull request shortly.

@sebastianbk sebastianbk linked a pull request Nov 28, 2023 that will close this issue
@hakenr
Copy link
Member

hakenr commented Nov 28, 2023

@sebastianbk Can you please provide me with a repro project/instructions, where I can see the error?
It seems you are missing the Bootstrap JavaScript.
Do you have it included in you host-page? (App.razor, _Host.cshtml, index.html or similar).
See https://havit.blazor.eu/#javascript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants