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.

Object reference not set to an instance of an object

See original GitHub issue
PuppeteerSharp.NavigationException: Navigation failed because browser has disconnected! (Connection failed to process Runtime.executionContextCreated. Object reference not set to an instance of an object..
    at PuppeteerSharp.DOMWorld.SetContext(ExecutionContext context) in C:\projects\puppeteer-sharp\lib\PuppeteerSharp\DOMWorld.cs:line 37
    at PuppeteerSharp.FrameManager.OnExecutionContextCreatedAsync(ContextPayload contextPayload) in C:\projects\puppeteer-sharp\lib\PuppeteerSharp\FrameManager.cs:line 291
    at PuppeteerSharp.FrameManager.Client_MessageReceived(Object sender, MessageEventArgs e) in C:\projects\puppeteer-sharp\lib\PuppeteerSharp\FrameManager.cs:line 218)
 ---> PuppeteerSharp.TargetClosedException: Navigation failed because browser has disconnected! (Connection failed to process Runtime.executionContextCreated. Object reference not set to an instance of an object..
    at PuppeteerSharp.DOMWorld.SetContext(ExecutionContext context) in C:\projects\puppeteer-sharp\lib\PuppeteerSharp\DOMWorld.cs:line 37
    at PuppeteerSharp.FrameManager.OnExecutionContextCreatedAsync(ContextPayload contextPayload) in C:\projects\puppeteer-sharp\lib\PuppeteerSharp\FrameManager.cs:line 291
    at PuppeteerSharp.FrameManager.Client_MessageReceived(Object sender, MessageEventArgs e) in C:\projects\puppeteer-sharp\lib\PuppeteerSharp\FrameManager.cs:line 218)
   at PuppeteerSharp.Helpers.TaskHelper.WithTimeout(Task task, Func`1 timeoutAction, TimeSpan timeout, CancellationToken cancellationToken) in C:\projects\puppeteer-sharp\lib\PuppeteerSharp\Helpers\TaskHelper.cs:line 82
   at PuppeteerSharp.FrameManager.NavigateFrameAsync(Frame frame, String url, NavigationOptions options) in C:\projects\puppeteer-sharp\lib\PuppeteerSharp\FrameManager.cs:line 130
   --- End of inner exception stack trace ---
PuppeteerSharp.NavigationException: Protocol error (Page.navigate): Session closed. Most likely the Page has been closed.Close reason: Connection failed to process Runtime.executionContextCreated. Object reference not set to an instance of an object..
    at PuppeteerSharp.DOMWorld.SetContext(ExecutionContext context) in C:\projects\puppeteer-sharp\lib\PuppeteerSharp\DOMWorld.cs:line 37
    at PuppeteerSharp.FrameManager.OnExecutionContextCreatedAsync(ContextPayload contextPayload) in C:\projects\puppeteer-sharp\lib\PuppeteerSharp\FrameManager.cs:line 291
    at PuppeteerSharp.FrameManager.Client_MessageReceived(Object sender, MessageEventArgs e) in C:\projects\puppeteer-sharp\lib\PuppeteerSharp\FrameManager.cs:line 218
 ---> PuppeteerSharp.PuppeteerException: Protocol error (Page.navigate): Session closed. Most likely the Page has been closed.Close reason: Connection failed to process Runtime.executionContextCreated. Object reference not set to an instance of an object..
    at PuppeteerSharp.DOMWorld.SetContext(ExecutionContext context) in C:\projects\puppeteer-sharp\lib\PuppeteerSharp\DOMWorld.cs:line 37
    at PuppeteerSharp.FrameManager.OnExecutionContextCreatedAsync(ContextPayload contextPayload) in C:\projects\puppeteer-sharp\lib\PuppeteerSharp\FrameManager.cs:line 291
    at PuppeteerSharp.FrameManager.Client_MessageReceived(Object sender, MessageEventArgs e) in C:\projects\puppeteer-sharp\lib\PuppeteerSharp\FrameManager.cs:line 218
   at PuppeteerSharp.CDPSession.SendAsync(String method, Object args, Boolean waitForCallback) in C:\projects\puppeteer-sharp\lib\PuppeteerSharp\CDPSession.cs:line 157
   at PuppeteerSharp.CDPSession.SendAsync[T](String method, Object args) in C:\projects\puppeteer-sharp\lib\PuppeteerSharp\CDPSession.cs:line 109
   at PuppeteerSharp.FrameManager.NavigateAsync(CDPSession client, String url, String referrer, String frameId) in C:\projects\puppeteer-sharp\lib\PuppeteerSharp\FrameManager.cs:line 147
   at PuppeteerSharp.FrameManager.NavigateFrameAsync(Frame frame, String url, NavigationOptions options) in C:\projects\puppeteer-sharp\lib\PuppeteerSharp\FrameManager.cs:line 130
   --- End of inner exception stack trace ---

https://github.com/hardkoded/puppeteer-sharp/blob/8262c805fc32a63cb3390d71a26260c2c5224013/lib/PuppeteerSharp/DOMWorld.cs#L39

https://github.com/puppeteer/puppeteer/blob/b349c91e7df76630b7411d6645e649945c4609bd/src/common/DOMWorld.ts#L119

See upstream issue https://github.com/puppeteer/puppeteer/issues/4197

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

0reactions
kblokcommented, Jul 3, 2021

Closed due to inactivity. Feel free to reopen it if needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Object Reference Not Set to an Instance of an Object
This infamous and dreaded error message happens when you get a NullReferenceException. This exception is thrown when you try to access a member—for...
Read more >
What does "Object reference not set to an instance of an ...
In a nutshell it means.. You are trying to access an object without instantiating it.. You might need to use the "new" keyword...
Read more >
Object reference not set to an instance of an object. - Forum
The message "object reference not set to an instance of an object" means that you are referring to an object the does not...
Read more >
How to solve error object reference not set to an instance of ...
I work on csharp i get error object reference not set to an instance of an object code give me error var Data...
Read more >
Fix: "Object Reference Not Set to an Instance of ...
The error message "Object reference not set to an instance of an object" means that perhaps you're referring to an object that doesn't...
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