canove / whaticket-community

A very simple Ticket System based on WhatsApp messages, that allow multi-users in same WhatsApp account.
MIT License
1.55k stars 795 forks source link

[nodemon] app crashed - waiting for file changes before starting... #516

Closed Guiviniac closed 1 year ago

Guiviniac commented 1 year ago

require() of ES modules is not supported. require() of /home/ittnet/ITWPP/backend/node_modules/multer/index.js from /home/ittnet/ITWPP/backend/dist/config/upload.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules. Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/ittnet/ITWPP/backend/node_modules/multer/package.json.

at Object.Module._extensions..js (internal/modules/cjs/loader.js:1015:13)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/ittnet/ITWPP/backend/dist/config/upload.js:7:34)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/ittnet/ITWPP/backend/dist/app.js:42:34)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/ittnet/ITWPP/backend/dist/server.js:7:31)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) {

code: 'ERR_REQUIRE_ESM'

Quando eu vou dar um start do backend do Whaticket , a mensagem acima aparece e o app não inicia, alguem poderia me ajudar??Estou fazendo a instalação no Ubuntu LTS 22.04.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

DevShop1251 commented 1 year ago

Estou com o mesmo problema. Já conseguiu uma solução?

Guiviniac commented 1 year ago

@DevShop1251 Nunca, até hoje sem funcionar

DevShop1251 commented 1 year ago

O meu acabou de dar esse problema, reinstalei o banco de dados e voltou a funcionar.

dev-dfBueno commented 1 year ago

Tente acessar o arquivo: node_modules/whatsapp-web.js/src/util/Injected.js

alterar a linha que contem as informações: window.Store.QueryExist = window.mR.findModule('queryExists')[0].queryExists;

para:

window.Store.QueryExist = window.mR.findModule('queryExists')[0] ? window.mR.findModule('queryExists')[0].queryExists : window.mR.findModule('queryExist')[0].queryWidExists;

E depois reinicie o backend, pode ser que resolva.

DevShop1251 commented 1 year ago

Olá, funcionou quando alterou o arquivo Injected.js?

Guiviniac commented 1 year ago

@dev-dfBueno Não funcionou.. continua dando o mesmo erro

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.