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

Use user-defined menus in Blazor's LoginDisplay. #5988

Merged
merged 5 commits into from Nov 3, 2020

Conversation

maliming
Copy link
Member

Fix #5970

InvokeVoidAsync caused an exception, and I did find a solution. ,

await JsRuntime.InvokeVoidAsync("open", uri, "_blank");
blazor.webassembly.js:1 Uncaught (in promise) TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'Window'
    --- property 'window' closes the circle
    at JSON.stringify (<anonymous>)
    at blazor.webassembly.js:1

@hikalkan
Copy link
Member

We should open the profile management page in the same window. So, don't use _blank. But I don't know why it didn't worked. Maybe await JsRuntime.InvokeVoidAsync("window.open", uri, "_blank"); would work.

@cotur
Copy link
Contributor

cotur commented Oct 30, 2020

@hikalkan yes we should open in same page.

Related issue.

dotnet/aspnetcore#16632 (comment)

This is because window.open returns a WindowProxy object (see https://developer.mozilla.org/en-US/docs/Web/API/Window/open). WindowProxy is not JSON-serializable, so can't be used as a return value to .NET code.

To fix this, don't call window.open directly, but instead call a JS function of your own that either returns nothing or returns something that is JSON-serializable.

@cotur cotur merged commit dc997e5 into rel-3.3 Nov 3, 2020
@cotur cotur deleted the maliming/blazor-patch branch November 3, 2020 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wrong account management url lead to 404 in blazor wasm
3 participants