Implementation of uPlot on Blazor WASM
See original GitHub issueI’ve been trying to implement uPlot on Blazor for a while now. Sadly I had no luck. I am not a professional programmer by any means. I’m very new to JS and I’ve been getting the following error when I run the application:
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: then is not a function
TypeError: then is not a function
at new uPlot (https://localhost:44326/dist/uPlot.iife.js:3902:7)
at generateUPlot (https://localhost:44326/js/MuPlot.js:48:10)
at https://localhost:44326/_framework/blazor.webassembly.js:1:3942
at new Promise (<anonymous>)
at Object.beginInvokeJSFromDotNet (https://localhost:44326/_framework/blazor.webassembly.js:1:3908)
at Object.w [as invokeJSFromDotNet] (https://localhost:44326/_framework/blazor.webassembly.js:1:64006)
at _mono_wasm_invoke_js_blazor (https://localhost:44326/_framework/dotnet.5.0.1.js:1:190800)
at do_icall (<anonymous>:wasm-function[10596]:0x194e58)
at do_icall_wrapper (<anonymous>:wasm-function[3305]:0x79df9)
at interp_exec_method (<anonymous>:wasm-function[2155]:0x44ad3)
Microsoft.JSInterop.JSException: then is not a function
TypeError: then is not a function
at new uPlot (https://localhost:44326/dist/uPlot.iife.js:3902:7)
at generateUPlot (https://localhost:44326/js/MuPlot.js:48:10)
at https://localhost:44326/_framework/blazor.webassembly.js:1:3942
at new Promise (<anonymous>)
at Object.beginInvokeJSFromDotNet (https://localhost:44326/_framework/blazor.webassembly.js:1:3908)
at Object.w [as invokeJSFromDotNet] (https://localhost:44326/_framework/blazor.webassembly.js:1:64006)
at _mono_wasm_invoke_js_blazor (https://localhost:44326/_framework/dotnet.5.0.1.js:1:190800)
at do_icall (<anonymous>:wasm-function[10596]:0x194e58)
at do_icall_wrapper (<anonymous>:wasm-function[3305]:0x79df9)
at interp_exec_method (<anonymous>:wasm-function[2155]:0x44ad3)
at Microsoft.JSInterop.JSRuntime.<InvokeAsync>d__15`1[[System.Object, System.Private.CoreLib, Version=5.0.0.0,
Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync(IJSRuntime jsRuntime, String identifier, Object[] args)
at Blazor5.Pages.Visualizer.DrawMuGraph() in
C:\\Visualizer.razor:line 84
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
I honestly haven’t figured out the exact issue yet. I would greatly appreciate it if I could have some help or pointers!
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
File Upload with Blazor WebAssembly and ASP.NET Core ...
In this article, we are going to learn about the File Upload with Blazor WebAssembly and ASP.NET Core Web API as the backend...
Read more >Blazor WebAssembly, .NET Single-Page Applications - Medium
A UI diff is calculated and sent back to the browser in a binary format. Blazor WebAssembly: it is a single-page application (SPA)...
Read more >Blazor WASM: File Upload - MultipartFormDataContent.Add ...
Blazor WASM: File Upload - MultipartFormDataContent.Add() throws internal Invalid JSON ... We don't show it implemented as a partial class.
Read more >Call a web API from ASP.NET Core Blazor - Microsoft Learn
The Blazor WebAssembly coverage addresses the following subjects: ... see the Blazor Server file upload example that uploads files to a web ...
Read more >How to upload FileSelect Results from Blazor WASM app
I am trying to use the File Select component in a Blazor WASM app to ... that has upload functionality implemented: FileSelect upload....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i’m guessing whatever you’re passing as the third argument to the uPlot constructor is neither a dom element, nor a callable function, so it’s crashing here with the assumption that it’s a function:
https://github.com/leeoniya/uPlot/blob/a91bdcecae048a805f8e8be7a139f260dad065f1/src/uPlot.js#L2316
gonna close this, since i think that’s all that needs to be done on the uPlot side, but feel free to ask more questions here, if needed.