awating launch just closes and do nothing
See original GitHub issueI’m using the code below, when i debug it reaches using (var browser = await Puppeteer.LaunchAsync(options, Downloader.DefaultRevision))
Then it just close down and saves no file. What am i missing? It never reaches and lines after that.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PuppeteerSharp;
using System.IO;
namespace ConsoleApp {
class Program {
public static void Main(string[] args) {
Task r = Run(args);
}
public static async Task Run(string[] args) {
var options = new LaunchOptions {
Headless = true
};
Console.WriteLine("Downloading chromium");
await Downloader.CreateDefault().DownloadRevisionAsync(Downloader.DefaultRevision);
Console.WriteLine("Navigating google");
using (var browser = await Puppeteer.LaunchAsync(options, Downloader.DefaultRevision))
using (var page = await browser.NewPageAsync()) {
await page.GoToAsync("http://www.google.com");
Console.WriteLine("Generating PDF");
await page.PdfAsync(Path.Combine(Directory.GetCurrentDirectory(), "google.pdf"));
Console.WriteLine("Export completed");
if (!args.Any(arg => arg == "auto-exit")) {
Console.ReadLine();
}
}
}
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Game crashing at 'awaiting session start' every single time
Was crashing in awaiting session start every time before, never again since then. Just make sure you don't delete all your data.
Read more >Tf2 instantly Closes After it says "Preparing to launch"
Basically when I try to launch tf2 it will close the instant it's finished "Preparing to launch" The problem ocurred when I closed...
Read more >Fix Rocket League: How to Solve Won't Launch and Crashing ...
In this video, we'll show you how to fix common issues with Rocket League, including game crashes and startup problems.
Read more >Node exits without error and doesn't await promise (Event ...
I'm pretty sure the answer to this is that there simply is nothing running and no system events/files open so node considers the...
Read more >Overwolf Not Launching / Crashing On Launch
Press the Windows key + R · Type in: appwiz.cpl · Click on "Turn Windows features on or off" · Look for the...
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
@Suresokken Can you say what you did to work around this? I’m also getting ‘An attempt was made to transition a task to a final state when it had already completed.’ when calling;
using (var page = await browser.NewPageAsync())
I found another way, so i will close this