11

I have created a Blazor Server application in .NET6.but recently I've upgraded it to.NET7.since this time,i am getting above issue .

Error: Microsoft.JSInterop.JSException: Converting circular structure to JSON --> starting at object with constructor 'Window' --- property 'window' closes the circle TypeError: Converting circular structure to JSON --> starting at object with constructor 'Window' --- property 'window' closes the circle at JSON.stringify ()

this issue is occurring from this line

await _jsRuntime.InvokeAsync<object>("open", url, "_blank");

this line is responsible for opening a URL in a new tab on the browser. once I click on a navigation bar link, the above line is called and occurred this issue.is there anybody who knows an answer to this issue? please help me, appreciate all your answers.

buddhi chamalka
  • 781
  • 5
  • 23

1 Answers1

24

I changed this line

await _jsRuntime.InvokeAsync<object>("open", url, "_blank");

as this

await _jsRuntime.InvokeVoidAsync("open", url, "_blank");

after that, I didn't get that issue.

buddhi chamalka
  • 781
  • 5
  • 23