You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using PuppeteerSharp v13.0.1(.NET 6 web app ) for connecting to a remote chromium browser (it runs in a docker container in Azure, browserless/chrome:latest) navigating to multiple URLs in our own system(we are using Angular for our FE) and generating PDF documents.
During the export process we are using single IBrowser instance with 10 IPage (tabs). Randomly we get WaitTaskTimeoutException, TargetClosedException and NavigationException, which are properly handled and retry logic is run.
Yesterday I've seen for the first time
"System.NullReferenceException: Object reference not set to an instance of an object.
at PuppeteerSharp.Frame.WaitForSelectorAsync(String selector, WaitForSelectorOptions options) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Frame.cs:line 121"
but there isn't anything specific.
The issue happens both in my local dev environment and in Azure Web App.
This code is run await page.GoToAsync($"{rpBaseUrl}/form/{stageId}/display/{user.Id}?pdfPrintHeadless=true"); await page.WaitForSelectorAsync("body.form-loaded"); var pdf = await page.PdfDataAsync(new PdfOptions { MarginOptions = new PuppeteerSharp.Media.MarginOptions { Bottom = "0.3in", Left = "0.3in", Right = "0.3in", Top = "0.3in" }, Landscape = false, PrintBackground = true });
To me it looks like a bug in the library, but maybe I'm missing something... Any ideas or suggestions are welcome...
The text was updated successfully, but these errors were encountered:
hi @kblok :)
thanks for the quick reply.
the other part of the stack trace is our own code, which I think is not relevant
but still, here it is: 12/12/2023 7:59:40 AM: System.NullReferenceException: Object reference not set to an instance of an object. 12/12/2023 7:59:40 AM: at PuppeteerSharp.Frame.WaitForSelectorAsync(String selector, WaitForSelectorOptions options) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Frame.cs:line 121 at Core.Services.PdfGeneration.PdfFormExportService.DownloadFormPdf(IPage page, String competitionId, Guid stageId, String stageNameForDisplay, UserWithAdminReviewStatusViewModel user) in C:\agent\_work\822\s\src\Core\Services\PdfGeneration\PdfFormExportService.cs:line 625 at Core.Services.PdfGeneration.PdfFormExportService.GeneratePdfsForFormStage(String competitionId, Guid stageFormId, String adminReviewIdForDisplay) in C:\agent\_work\822\s\src\Core\Services\PdfGeneration\PdfFormExportService.cs:line 585 at Core.Services.PdfGeneration.PdfFormExportService.StartPdfGeneration(IEnumerable1 stageIds, String adminReviewIdForDisplay) in C:\agent_work\822\s\src\Core\Services\PdfGeneration\PdfFormExportService.cs:line 505 `
As you see. It's hard to get more data from that line 121. If you want to move forward, I think you could either clone this repo and link the project instead of using the nuget package or give me access to some URL I can use to debug it (you can send private info by email)
We are using PuppeteerSharp v13.0.1(.NET 6 web app ) for connecting to a remote chromium browser (it runs in a docker container in Azure, browserless/chrome:latest) navigating to multiple URLs in our own system(we are using Angular for our FE) and generating PDF documents.
During the export process we are using single IBrowser instance with 10 IPage (tabs). Randomly we get WaitTaskTimeoutException, TargetClosedException and NavigationException, which are properly handled and retry logic is run.
Yesterday I've seen for the first time
"System.NullReferenceException: Object reference not set to an instance of an object.
at PuppeteerSharp.Frame.WaitForSelectorAsync(String selector, WaitForSelectorOptions options) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Frame.cs:line 121"
I've checked the source code here:
https://github.com/hardkoded/puppeteer-sharp/blob/master/lib/PuppeteerSharp/Frame.cs
but there isn't anything specific.
The issue happens both in my local dev environment and in Azure Web App.
This code is run
await page.GoToAsync($"{rpBaseUrl}/form/{stageId}/display/{user.Id}?pdfPrintHeadless=true"); await page.WaitForSelectorAsync("body.form-loaded"); var pdf = await page.PdfDataAsync(new PdfOptions { MarginOptions = new PuppeteerSharp.Media.MarginOptions { Bottom = "0.3in", Left = "0.3in", Right = "0.3in", Top = "0.3in" }, Landscape = false, PrintBackground = true });
To me it looks like a bug in the library, but maybe I'm missing something... Any ideas or suggestions are welcome...
The text was updated successfully, but these errors were encountered: