question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implementation of uPlot on Blazor WASM

See original GitHub issue

I’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:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
leeoniyacommented, Dec 10, 2020

TypeError: then is not a function

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

0reactions
leeoniyacommented, Dec 17, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found