I’m trying build a customized puppeteer module for nestjs based on outdated source nest-puppeteer . It works well with with using lauch function of Puppeteer. But I would add a Debug Mode in case I would connect to other Chromnium instance. The problem is that WebSocket keep lost everytime Puppeteer fetch to EndpointURL to getWSEndpoint even through the returned result is right. Then without Websocket, it couldn’t create BrowserWSEndpoint then the error was throw out. I don’t know the reason, it does not happen with my simple Puppeteer sample. You can see two photos as belows, the first One I captured from my module and the other I capture from my simple project. The issue happe on /node_modules/puppeteer/lib/cjs/puppeteer/common/BrowserConnection.js line 96 of Puppeteer source.
You can download the my source code is here. I already setup a test for this case. you just run “npm test”
You could lauch a chromenium instance by run “node lauchBrowserInstance.js” from my sample repo.
This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.