Closed bdizzleog closed 2 years ago
I tried breaking down GetElementById but it actually seems that it's not erroring in this method.
It seems as though it is erroring in 'EventHorizonBlazorInterop.FuncClass(x,x,x)'
Nuget shows the latest version 0.2.5
I added EventHorizon.Blazor.Interop to my project so I could debug.
It looks like 'RUNTIME' returns null.
This whole time it was my own fault for missing 1 part of the setup.
I was missing in App.razor:
@code {
[Inject]
public IJSRuntime JSRuntime { get; set; }
protected override void OnInitialized()
{
EventHorizonBlazorInterop.JSRuntime = JSRuntime;
}
}
Hello,
I've ran into an issue when I was using this generator in a Blazor Server project and it worked fine, but in production it would lag for the client so I decided to switch my project to webassembly and use the generator for that instead.
Everything seemed to have gone too smoothly, which it did, when I start my project 'Canvas.GetElementById' returns null. This has been very frustrating as I haven't been able to figure it out for days now.
It is difficult to debug because right when it goes into the method it returns null immediately.
And right when I step into the return: 'Object reference not set to an instance of an object.'
I'm not sure what this could be, I tried to copy Canvas.cs from the sample projects but it didn't make a difference.