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

MissingMethodException running Chart.toSVGString using Plotly.Net.ImageExport #361

Open
Altariarite opened this issue Dec 14, 2022 · 1 comment

Comments

@Altariarite
Copy link

Calling Chart.toSVGString gives me:

Unhandled exception. System.MissingMethodException: Method not found: 'System.Threading.Tasks.Task`1<PuppeteerSharp.Browser> PuppeteerSharp.Puppeteer.LaunchAsync(PuppeteerSharp.LaunchOptions, Microsoft.Extensions.Logging.ILoggerFactory)'.
   at <StartupCode$Plotly-NET-ImageExport>[email protected](Unit unitVar)
   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvoke[T,TResult](AsyncActivation`1 ctxt, TResult result1, FSharpFunc`2 part2) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 510
   at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 112
--- End of stack trace from previous location ---
   at Microsoft.FSharp.Control.AsyncResult`1.Commit() in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 454
   at Microsoft.FSharp.Control.AsyncPrimitives.QueueAsyncAndWaitForResultSynchronously[a](CancellationToken token, FSharpAsync`1 computation, FSharpOption`1 timeout) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 1140
   at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronously[T](CancellationToken cancellationToken, FSharpAsync`1 computation, FSharpOption`1 timeout) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 1167
   at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken) in D:\a\_work\1\s\src\FSharp.Core\async.fs:line 1511
   at <StartupCode$myApp>.$Program.main@() in C:\Users\altaria\fsharp\Valueline\myApp\Program.fs:line 44

My code snippet:

// Api.chart is a GenericChart
open Giraffe.ViewEngine
let chartView = Api.chart |> Chart.toSVGString (Width = 800, Height = 600) |> Text

It looks like there's some issue calling a Puppeteer function?
I am on .NET 6 and running dotnet watch. I've tried PuppeteerSharp version 8.0.0 and 6.0.0 with no success.

@Altariarite
Copy link
Author

I managed to get it running by doing paket add NETStandard.Library --version 2.0.3 after seeing this post on StackOverflow. Maybe I am missing something obvious here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant