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.

puppeteer-firefox: ERROR: failed to call method 'Browser.deleteCookies'

See original GitHub issue

I receive the following error when I try to run the following example using puppeteer-firefox version 0.5.0:

const pptrFirefox = require('puppeteer-firefox');
(async () => {
  const browser = await pptrFirefox.launch({headless: false});
  const page = await browser.newPage();
  await page.goto('https://www.google.com');
  await page.setCookie({name: 'mycookie', value: 'myvalue'});
})();

$ node sample.js 
(node:92226) UnhandledPromiseRejectionWarning: Error: Protocol error (Browser.deleteCookies): ERROR: failed to call method 'Browser.deleteCookies' with parameters {
  "browserContextId": null,
  "cookies": [
    {
      "url": "https://www.google.com/",
      "name": "mycookie"
    }
  ]
}
Expected "<root>.browserContextId" to be |string|; found |object| `null` instead. _dispatch@chrome://juggler/content/protocol/Dispatcher.js:100:15

    at node_modules/puppeteer-firefox/lib/Connection.js:74:56
    at new Promise (<anonymous>)
    at Connection.send (node_modules/puppeteer-firefox/lib/Connection.js:73:12)
    at Page.deleteCookie (node_modules/puppeteer-firefox/lib/Page.js:115:22)
    at Page.<anonymous> (node_modules/puppeteer-firefox/lib/helper.js:32:23)
    at Page.setCookie (node_modules/puppeteer-firefox/lib/Page.js:135:16)
    at Page.<anonymous> (node_modules/puppeteer-firefox/lib/helper.js:32:23)
    at sample.js:6:14

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mjzffrcommented, Jan 13, 2020

I’m closing this issue since the experimental puppeteer-firefox package is no longer maintained. A replacement will be available later this year. You can learn more about Mozilla’s work on this at https://wiki.mozilla.org/Remote

See also https://github.com/puppeteer/puppeteer/pull/5137

1reaction
james-berrycommented, Jun 17, 2019

still getting ERROR: failed to call method ‘Browser.getCookies’ using:

const browser = await puppeteer.launch({
    headless: false,
    args: ['--start-fullscreen', '--incognito'],
    devtools: true,
  });
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does not work Puppeteer-firefox on servers?
I had the same problem (failed to Launch Firefox) on my VPS Windows. So i went to node_modules/puppeteer-firefox/.local-browser/.
Read more >
Puppeteer | Puppeteer
Create an automated testing environment using the latest JavaScript and browser features. Capture a timeline trace of your site to help diagnose performance ......
Read more >
mozilla-release: changeset 564654 ... - Mercurial
waitForSelector(selector[, options])](#pagewaitforselectorselector-options) +Puppeteer methods might throw errors if they are unable to fulfill a request.
Read more >
Puppeteer documentation - DevDocs
Puppeteer methods might throw errors if they are unable to fulfill a request. ... After calling disconnect , the Browser object is considered...
Read more >
How to Run Puppeteer with Firefox Instead of Chrome
You can use automation tool like Puppeteer to carry out automated testing on these browsers. What is Puppeteer. Puppeteer is a Node library...
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