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

Uncaught Error: Collection was modified #127

Closed
anders130 opened this issue Nov 27, 2023 · 1 comment
Closed

Uncaught Error: Collection was modified #127

anders130 opened this issue Nov 27, 2023 · 1 comment
Labels
blazor-v7 Applied to .NET 7.0 bug Something isn't working core Handled in Piral.Blazor.Core
Milestone

Comments

@anders130
Copy link

Bug Report

Environment Details and Version

  • Piral Version: 1.3.3
  • Blazor Verion: net7.0.10 / 7.0.11
  • OS: Windows 11
  • Browser: Firefox, Edge, Chrome
  • Node Version: v20.7.0
  • Piral.Blazor: 7.0.10-pre.20231110.1

Description

Everytime, a PiletService Method is executed, the following error message appears inside the browser console:

Uncaught (in promise) Error: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.Collections.Generic.List`1.Enumerator[[Piral.Blazor.Core.PiletService.EventListener, Piral.Blazor.Core, Version=7.0.9.0, Culture=neutral, PublicKeyToken=null]].MoveNextRare()
   at System.Collections.Generic.List`1.Enumerator[[Piral.Blazor.Core.PiletService.EventListener, Piral.Blazor.Core, Version=7.0.9.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at Piral.Blazor.Core.PiletService.CallEventListeners(String type, JsonElement args) in /home/vsts/work/1/s/src/Piral.Blazor.Core/PiletService.cs:line 142
   at Piral.Blazor.Core.JSBridge.ProcessEvent(String type, JsonElement args) in /home/vsts/work/1/s/src/Piral.Blazor.Core/JSBridge.cs:line 110
   at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.InvokeSynchronously(JSRuntime jsRuntime, DotNetInvocationInfo& callInfo, IDotNetObjectReference objectReference, String argsJson)
   at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.BeginInvokeDotNet(JSRuntime jsRuntime, DotNetInvocationInfo invocationInfo, String argsJson)
    at Object.endInvokeDotNetFromJS (blazor.webassembly.js:1:3549)
    at Object.Xt [as endInvokeDotNetFromJS] (blazor.webassembly.js:1:63263)
    at Object.Gt [as invokeJSFromDotNet] (blazor.webassembly.js:1:62760)
    at Object.Ii (dotnet.7.0.12.f0vb2lepsw.js:5:71974)
    at _mono_wasm_invoke_js_blazor (dotnet.7.0.12.f0vb2lepsw.js:14:103886)
    at 00993936:0x1d6b8
    at 00993936:0x1cae6
    at 00993936:0xe1d6
    at 00993936:0xd046
    at 00993936:0x1a2379

Steps to Reproduce

  1. clone my repo on dev branch (https://github.com/anders130/piral-distributed-example/tree/dev)
  2. build the app-shell
  3. build the solution
  4. debug the BlazorPilet.Counter2 project
  5. navigate to the counter2 page and click the button with browser console enabled

Actual behavior

Executing any PiletService-Method triggers the error but the functionality seems to work regardless.

@anders130 anders130 added the bug Something isn't working label Nov 27, 2023
@FlorianRappl FlorianRappl added this to the v10 milestone Nov 28, 2023
@FlorianRappl
Copy link
Collaborator

Thanks for the report. Fixed and will be part of the next release.

@FlorianRappl FlorianRappl added blazor-v7 Applied to .NET 7.0 core Handled in Piral.Blazor.Core labels Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blazor-v7 Applied to .NET 7.0 bug Something isn't working core Handled in Piral.Blazor.Core
Projects
None yet
Development

No branches or pull requests

2 participants