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.

stuck at await browser.NewPageAsync()

See original GitHub issue

I am just trying to create a simple console app to generate PDF file but program doesn’t execute after that line var page = await browser.NewPageAsync(); also i am not getting any exception as program is just stuck. Any help much appreciated. console app code: Using .NET Core 2.2, PuppeteerSharp 1.17.1, C# version 7.1

class Program
   {
       public static async Task Main(string[] args)
       {
           await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultRevision);
           var browser = await Puppeteer.LaunchAsync(new LaunchOptions { Headless = true });
           var page = await browser.NewPageAsync();
           PdfOptions pdfOptions = new PdfOptions();
           pdfOptions.PreferCSSPageSize = true;
           await page.GoToAsync("http://www.google.com", WaitUntilNavigation.Load);
           await page.PdfAsync(Path.Combine(Directory.GetCurrentDirectory(), "google.pdf"), pdfOptions);
       }
     
   }

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:57 (22 by maintainers)

github_iconTop GitHub Comments

4reactions
MussaratAzizcommented, Jul 16, 2019

Sure i did that but still stuck on this as well.

3reactions
koryphaeecommented, Oct 12, 2021

I have this issue again in version 5.0.0. I am running Puppeteer Sharp in a Linux Docker container. The issue does not occur when I run it directly on Windows 10.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Puppeteer-sharp: page is crashed from browser. ...
NewPageAsync() . Then I turned on Devtools and saw the page is crashed in Chromium. var browserFetcher = new BrowserFetcher(); await ...
Read more >
Use PuppeteerSharp.Browser.NewPageAsync in ...
Use the NewPageAsync method in PuppeteerSharp package in your next ... FirstOrDefault() ?? await browser. NewPageAsync ();75 await browserPage.
Read more >
Puppeteer in Node.js: Common Mistakes to Avoid
Puppeteer is a powerful Node.js library for browser automation, but comes with pitfalls. Find out some of the common mistakes you should ...
Read more >
[Solved]-Puppeteer Sharp strange behaviour-C#
Run() will be stuck due to NewPageAsync() method. Bad behaviour: Task[] Tasks = new Task[1]; Browser browser = await Puppeteer.
Read more >
Page | Playwright .NET
await using var browser = await playwright.Webkit.LaunchAsync(); var page = await browser.NewPageAsync(); await page.GotoAsync("https://www.theverge.com");
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