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.

awating launch just closes and do nothing

See original GitHub issue

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

github_iconTop GitHub Comments

1reaction
RyanONeill1970commented, Jun 18, 2018

@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())

1reaction
JimmyLillegaardcommented, Jun 11, 2018

I found another way, so i will close this

Read more comments on GitHub >

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

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