How to solve Puppeteer Chrome Error ERR_INVALID_ARGUMENT

1 · Christian · March 30, 2020, midnight
I was encountering this error when trying to set up a puppeteer instance with a proxy. I tried different approaches, but were either outdated or led me to a wrong path to try to solve my problem. The main issue was that I tried to authenticate to the proxy with setExtraHTTPHeaders, like this: await page.setExtraHTTPHeaders({ 'Proxy-Authorization': 'Basic ...' }); Then I stumbled upon the following piece of chromium source code: // Removing headers can't make the set of pre-existing heade...