-
Notifications
You must be signed in to change notification settings - Fork 151
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
NullReferenceException when viewing chart #178
Comments
@ADringer I'm running into the same exception with a different library, anyway the scenario is the same: getting data from an external source through an HTTP request. |
@fleed yes, was able to get round this by moving my code round a little. The issue I think is mainly with the
And then do the async HTTP call in the
Hope that helps! |
This looks like a timing issue. The OnInitializedAsync call may not have been completed before Blazor makes its first render, so _chart would have been null. There are three ways you can work around this:
I'll go ahead and close this issue. |
Describe the bug
I have a strong feeling it's a user issue, but I'm getting the following error when trying to view a chart in my wasm project:
Which Blazor project type is your bug related to?
Which charts does this bug apply to?
Bar chart
To Reproduce
Steps to reproduce the behavior:
Create a Blazor WASM project.
Added the following to index.html in the client app:
The following in
_imports.razor
:And the razor component:
Expected behavior
Error logged in the console.
I imagine I've done something obviously wrong, so apologies for using your time!
The text was updated successfully, but these errors were encountered: