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.

Error about "Chromium revision is not downloaded. Run BrowserFetcher.DownloadAsync or download Chromium manually"

See original GitHub issue

Description

There is a method ,named OpenChromiumPage(), which open Chromium page as headless=true. While opening chromium, download zip file with revision number but its size 0KB.

After that, the method threw an exception with message says that “Chromium revision is not downloaded. Run BrowserFetcher.DownloadAsync or download Chromium manually”

Sometimes zip file extracted but when try to download chromium, giving the same error.

Should I update or add any code to below method?

My code located below.

         public static async Task<Page> OpenChromiumPage()
        {
            var browserFetcher = new BrowserFetcher(new BrowserFetcherOptions
            {
                Path = "C:\\Chromium"
            });
            await browserFetcher.DownloadAsync(BrowserFetcher.DefaultRevision);
            var browser = await Puppeteer.LaunchAsync(new LaunchOptions
            {
                Headless = true,
                Timeout = 0
            });
            return await browser.NewPageAsync();
        }

Expected behavior:

Zip file extracted and Chromium works

Actual behavior:

“Chromium revision is not downloaded. Run BrowserFetcher.DownloadAsync or download Chromium manually”

Versions

Version of PuppeteerSharp : v1.19.0 but latest versions give same result. .NET runtime and version: .NET framework 4.6.2

Additional Information

I tried to set a value for ExecutablePath property which is chromium.exe file path. Then download and works.

Is there any other solution or What should I update my code?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
imlokeshcommented, Sep 13, 2020

You have to pass ExecutablePath to Puppeteer.LaunchAsync. It will look like this:

     public static async Task<Page> OpenChromiumPage()
    {
        var browserFetcher = new BrowserFetcher(new BrowserFetcherOptions
        {
            Path = "C:\\Chromium"
        });
        await browserFetcher.DownloadAsync(BrowserFetcher.DefaultRevision);
        var browser = await Puppeteer.LaunchAsync(new LaunchOptions
        {
            Headless = true,
            Timeout = 0,
            ExecutablePath = "c:\\....\\chrome.exe"
        });
        return await browser.NewPageAsync();
    }

If you do not pass Path in BrowserFetcher, the you do not need to add ExecutablePath because it will automatically look into default download location.

2reactions
kblokcommented, Dec 10, 2020

BrowserFetch will always create its own folder. You can get that folder if you call GetRevisionInfo and get the ExecutablePath property from there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Puppeteer Sharp: avoid downloading Chromium (bundle ...
1 Answer. Surely you shouldn't call BrowserFetcher if you want to avoid a download.
Read more >
A critical error: Chromium revision is not downloaded.
The work I'm doing is on a new MacBook Pro. In setting up the machine, I'd installed all the various dev tools I...
Read more >
Use PuppeteerSharp.BrowserFetcher.LocalRevisions in ...
Use the LocalRevisions method in PuppeteerSharp package in your next ... WriteLine(">> Installed revisions of Chrome not found - need to download new...
Read more >
Error: Chromium revision is not downloaded. Run "npm ...
Recently I have needed to solve a problem that involves generating a PDF file based on database conte...
Read more >
Class BrowserFetcher
BrowserFetcher can download and manage different versions of Chromium. BrowserFetcher operates on revision strings that specify a precise version of ...
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