wppconnect-team / wppconnect

WPPConnect is an open source project developed by the JavaScript community with the aim of exporting functions from WhatsApp Web to the node, which can be used to support the creation of any interaction, such as customer service, media sending, intelligence recognition based on phrases artificial and many other things, use your imagination
https://wppconnect.io
Other
1.77k stars 305 forks source link

folderNameToken not working when browser instance param is setted #1881

Closed alexandre1921 closed 8 months ago

alexandre1921 commented 8 months ago

Description

I'm running my code on WSL. Because of this, I need to use the Chrome instance installed on my Linux. So, I created a browser with Puppeteer and tried passing it as a parameter to the wppconnect create method. However, when I do that, the folderNameToken seems to be ignored. This issue appears to be related to the browser instance, because when I don't pass it, the correct folder path is used as expected.

Environment

Steps to Reproduce

  1. Create an puppeteer instance
  2. Create a client
  3. Check if folder was created

Your Code

async function start() {
      const browser = await puppeteer.launch({
          executablePath: '/usr/bin/google-chrome',
      });

      return create({
          session: '1',
          browser,
          folderNameToken: 'tokens/wppconnect',
      })
}

start();
renat473 commented 8 months ago

I recommend not using wsl if necessary.

due to restrictions on browser and puppeteer execution