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.79k stars 307 forks source link

Error after upgrading to 1.28.1 #1911

Closed GDOR-11 closed 8 months ago

GDOR-11 commented 8 months ago

Description

After upgrading to the newer version, there is a runtime error in dist/controllers/browser.js

Sorry if there isn't enough information, This is my first time creating an issue :'-)

Environment

Steps to Reproduce

  1. upgrade to 1.28.1
  2. run

Log Output

/directory/node_modules/@wppconnect-team/wppconnect/dist/controllers/browser.js:102
var ChromeLauncher = __importStar(require("chrome-launcher"));
                                  ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /directory/node_modules/chrome-launcher/dist/index.js from /directory/node_modules/@wppconnect-team/wppconnect/dist/controllers/browser.js not supported.
Instead change the require of index.js in /directory/node_modules/@wppconnect-team/wppconnect/dist/controllers/browser.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/directory/node_modules/@wppconnect-team/wppconnect/dist/controllers/browser.js:102:35)
    at Object.<anonymous> (/directory/node_modules/@wppconnect-team/wppconnect/dist/api/layers/host.layer.js:69:17)
    at Object.<anonymous> (/directory/node_modules/@wppconnect-team/wppconnect/dist/api/layers/community.layer.js:72:20)
    at Object.<anonymous> (/directory/node_modules/@wppconnect-team/wppconnect/dist/api/layers/catalog.layer.js:72:25)
    at Object.<anonymous> (/directory/node_modules/@wppconnect-team/wppconnect/dist/api/layers/labels.layer.js:72:23)
    at Object.<anonymous> (/directory/node_modules/@wppconnect-team/wppconnect/dist/api/layers/status.layer.js:71:22)
    at Object.<anonymous> (/directory/node_modules/@wppconnect-team/wppconnect/dist/api/layers/profile.layer.js:72:22)
    at Object.<anonymous> (/directory/node_modules/@wppconnect-team/wppconnect/dist/api/layers/listener.layer.js:83:23)
    at Object.<anonymous> (/directory/node_modules/@wppconnect-team/wppconnect/dist/api/layers/sender.layer.js:109:24)
    at Object.<anonymous> (/directory/node_modules/@wppconnect-team/wppconnect/dist/api/layers/retriever.layer.js:72:22)
    at Object.<anonymous> (/directory/node_modules/@wppconnect-team/wppconnect/dist/api/layers/group.layer.js:72:25)
    at Object.<anonymous> (/directory/node_modules/@wppconnect-team/wppconnect/dist/api/layers/ui.layer.js:72:21)
    at Object.<anonymous> (/directory/node_modules/@wppconnect-team/wppconnect/dist/api/layers/controls.layer.js:72:18)
    at Object.<anonymous> (/directory/node_modules/@wppconnect-team/wppconnect/dist/api/layers/business.layer.js:71:24)
    at Object.<anonymous> (/directory/node_modules/@wppconnect-team/wppconnect/dist/api/whatsapp.js:78:24)
    at Object.<anonymous> (/directory/node_modules/@wppconnect-team/wppconnect/dist/index.js:32:18) {
  code: 'ERR_REQUIRE_ESM'
}

Your Code

const wppconnect = require("@wppconnect-team/wppconnect");
wppconnect.create({
    session: "minimal example"
});
voxsoftware commented 8 months ago

Still a problem with 1.28.2 Chrome browser never started. With chromium works.

icleitoncosta commented 8 months ago

Still a problem with 1.28.2

Chrome browser never started. With chromium works.

Please, reinstall. npm install or yarn install

voxsoftware commented 8 months ago

Still a problem with 1.28.2 Chrome browser never started. With chromium works.

Please, reinstall. npm install or yarn install

I tested reinstalling, and not working. Also I made a test, disabling headless, chrome browser starts, but never navigates to web.whatsapp webpage.