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

BUG Report: Cannot read properties of null (reading 'removeEventListener') #3779

Open
blackcatpolice opened this issue Apr 4, 2024 · 1 comment

Comments

@blackcatpolice
Copy link

InvokeAsync(async () => await JSRuntime.InvokeVoidAsync(JSInteropConstants.RemoveFileClickEventListener, _btn));

In my maui blazor project.

73|2024-04-04T13:43:38.2870067+00:00|ERROR|1|App|Cannot read properties of null (reading 'removeEventListener')
TypeError: Cannot read properties of null (reading 'removeEventListener')
at i.removeFileClickEventListener (https://0.0.0.0/_content/AntDesign/js/ant-design-blazor.js:1:36008)
at https://0.0.0.0/_framework/blazor.webview.js:1:3050
at new Promise ()
at g.beginInvokeJSFromDotNet (https://0.0.0.0/_framework/blazor.webview.js:1:3007)
at https://0.0.0.0/_framework/blazor.webview.js:1:48020
at EventTarget. (:7:62)
at EmbeddedBrowserWebView. (:1:40770)
74|2024-04-04T13:43:38.2871373+00:00|ERROR|1|App| at Microsoft.JSInterop.JS

I found this code in "UploadButton.razor.cs" .

I don't know why .

I think sometimes when dispose button, but the button has already dispose.

So I think all the dispose element methods need check the element is alive

@ElderJames
Copy link
Member

Thanks for contacting us @blackcatpolice , how did you use the Upload component?

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

No branches or pull requests

2 participants