Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent 'Navigating frame was detached' Error with GoToAsync Method #2856

Open
BiQingQing opened this issue Jan 3, 2025 · 7 comments
Open

Comments

@BiQingQing
Copy link

Description

Hi,

I am using the “IxBrowser” to open multiple Chrome instances and interact with them through a WebSocket connection. Occasionally, when using the GoToAsync method to navigate to a page, I encounter the following error:

Navigating frame was detached: Connection failed to process Target.attachedToTarget. Timeout of 1000 ms exceeded.

The browser is configured with a proxy, and when this error occurs, the page is still loading normally in the browser.

Could you please provide some advice or suggestions on how to address this issue? Any help would be greatly appreciated.

Thank you!

 var browser = await Puppeteer.ConnectAsync(new ConnectOptions
 {
     BrowserWSEndpoint = "ws..."
 });
 var page = await browser.NewPageAsync();
 await Task.Delay(2 * 1000);
 var navOptions = new NavigationOptions
 {
     Timeout = 60 * 1000,
     WaitUntil = new[]
     {
         WaitUntilNavigation.Load
     }
 };
 await page.GoToAsync("https://www.facebook.com/", navOptions);

Expected behavior:

jump link

Actual behavior:

page.GoToAsync method throws a NavigationException, Navigating frame was detached: Connection failed to process Target.attachedToTarget. Timeout of 1000 ms exceeded.

Versions

PuppeteerSharp v16.0.0 or v20.0.5
.NET Core 6.0

Additional Information

Navigating frame was detached: Connection failed to process Target.attachedToTarget. Timeout of 1000 ms exceeded. at PuppeteerSharp.Helpers.TaskHelper.WithTimeout[T](Task1 task, TimeSpan timeout, Func2 exceptionFactory) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Helpers/TaskHelper.cs:line 185
at PuppeteerSharp.Cdp.FrameManager.<>c__DisplayClass58_0.<<Client_MessageReceived>b__0>d.MoveNext() in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Cdp/FrameManager.cs:line 206

at PuppeteerSharp.Cdp.CdpFrame.GoToAsync(String url, NavigationOptions options) in /home/runner/work/puppeteer-sharp/puppeteer-sharp/lib/PuppeteerSharp/Cdp/CdpFrame.cs:line 106

@arronax23
Copy link

arronax23 commented Jan 8, 2025

I have encountered same error and so far I have no idea what to do about it :(
@BiQingQing have you manged to find workaround?
Has anyone solved this problem?

@kblok
Copy link
Member

kblok commented Jan 13, 2025

@BiQingQing did you report that to IxBrowser? I bet something is crashing on their side.

@BiQingQing
Copy link
Author

Thank you very much for your answer. I haven't reported this issue to IxBrowser yet, but I will do so now.

@BiQingQing BiQingQing closed this as not planned Won't fix, can't repro, duplicate, stale Jan 16, 2025
@BiQingQing BiQingQing reopened this Jan 16, 2025
@BiQingQing
Copy link
Author

@arronax23 Hi, are you also opening Chrome through IxBrowser?
I currently have no way to avoid this error. I can only catch this error, open a new page, and then jump again.

@kblok
Copy link
Member

kblok commented Jan 16, 2025

I have encountered same error and so far I have no idea what to do about it :( @BiQingQing have you manged to find workaround? Has anyone solved this problem?

Do you have any piece of code I can use to test this?

@mikrodotnet
Copy link

I'm not sure if this is exactly relevant to your issue but every version after 20.0.2 will not goto/load a page. It gets stuck forever loading the about:blank initial page. After a while of trial & error tests, I downgraded to PuppeteerSharp 20.0.2 and everything worked normally again so far.

Note: Debugged with Visual Studio 2922 on Win 10 Enterprise

@kblok
Copy link
Member

kblok commented Jan 27, 2025

I'm not sure if this is exactly relevant to your issue but every version after 20.0.2 will not goto/load a page. It gets stuck forever loading the about:blank initial page. After a while of trial & error tests, I downgraded to PuppeteerSharp 20.0.2 and everything worked normally again so far.

Note: Debugged with Visual Studio 2922 on Win 10 Enterprise

Could you provide a test to reproduce it? We have tests running on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants