Closed ericbrunner closed 7 months ago
After upgrading to 5.0.0 I get the same exception but with slightly different call-stack:
The exception occurs when I click into the input element. (blazor server site, .NET 8)
Error: Microsoft.JSInterop.JSException: Could not find 'addClickOutsideEvent' ('addClickOutsideEvent' was undefined).
Error: Could not find 'addClickOutsideEvent' ('addClickOutsideEvent' was undefined).
at https://localhost:44395/_framework/blazor.server.js:1:734
at Array.forEach (<anonymous>)
at l.findFunction (https://localhost:44395/_framework/blazor.server.js:1:702)
at _ (https://localhost:44395/_framework/blazor.server.js:1:5445)
at https://localhost:44395/_framework/blazor.server.js:1:3238
at new Promise (<anonymous>)
at y.beginInvokeJSFromDotNet (https://localhost:44395/_framework/blazor.server.js:1:3201)
at Yt._invokeClientMethod (https://localhost:44395/_framework/blazor.server.js:1:60713)
at Yt._processIncomingData (https://localhost:44395/_framework/blazor.server.js:1:58188)
at Yt.connection.onreceive (https://localhost:44395/_framework/blazor.server.js:1:51829)
at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
at Microsoft.JSInterop.JSObjectReferenceExtensions.InvokeVoidAsync(IJSObjectReference jsObjectReference, String identifier, Object[] args)
at BlazorDateRangePicker.DateRangePicker.Open()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
log @ blazor.server.js:1
unhandledError @ blazor.server.js:1
(anonymous) @ blazor.server.js:1
_invokeClientMethod @ blazor.server.js:1
_processIncomingData @ blazor.server.js:1
Yt.connection.onreceive @ blazor.server.js:1
s.onmessage @ blazor.server.js:1
I have tried server and client, net6 and net8 and I do not get this error. Please check your browser console for js script loading errors, it should load /_content/BlazorDateRangePicker/clickAndPositionHandler.js And please tell me what browser you are using
Edge Browser. At first it occured while debugging on localhost when I click the DateRangePicker but the error disappeared after several clicks. Then I noticed that it occurs when I do a dotnet publish of the app. So as Release build in DOTNET_ENVIRONMENT=Production. Here the error remains. No script load error in js console.
Kind regards, Erich
From: Sergey @.> Sent: Monday, January 22, 2024 5:55:44 PM To: jdtcn/BlazorDateRangePicker @.> Cc: Eric Brunner @.>; Author @.> Subject: Re: [jdtcn/BlazorDateRangePicker] Uncaught TypeError TypeError: clickAndPositionHandler.getPickerPosition is not a function (Issue #96)
I have tried server and client, net6 and net8 and I do not get this error. Please check your browser console for js script loading errors, it should load /_content/BlazorDateRangePicker/clickAndPositionHandler.js And please tell me what browser you are using
— Reply to this email directly, view it on GitHubhttps://github.com/jdtcn/BlazorDateRangePicker/issues/96#issuecomment-1904416402, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABROBL4TEP4D7QKQNWB7PA3YP2KZBAVCNFSM6AAAAABCFANUSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBUGQYTMNBQGI. You are receiving this because you authored the thread.Message ID: @.***>
Thanks for your help, I found the problem, made a mistake while refactoring, I published version 5.1.0 with the fix, please check it out
@jdtcn
When the DateRangePicker is clicked on mobile device my ErrorBoundary catches an exception and reloads the page. Any idea what causes the exception? It occurs sind v. 5.x
In Chrome it works. In Edge it doesn't. I guess its a caching issue.
After clearing Edge cache it worked.
Hi, I think this time the problem is not with the picker, I see that sometimes there is an error happens on the server but the browser console is clear. I took your code and it works in edge/chrome/firefox, maybe the exception happens after selecting the date. If you have a stack trace please share it.
@jdtcn had to clear Edge cache. You can try it: take version 4.5 and open in Edge. Upgrade to 5.x and open again in Edge. The issue I described should appear.
Indeed, there is a problem with the cache, it doesn't try to load the new js file version even though according to the headers it should, anyway I fixed it with the grandfather method, added ?v={Version}
to the file name, published version 5.2.0 with the fix. Thank you for your help!
I should get rid of that js altogether, I'll do it sometime.
Hi,
I updated to v. 5.0.0. but see the error in the VS console.
Here my setup in App.razor
Here my wrapper Component Code: