Closed reactmore closed 2 years ago
Is this a cPanel hosting? I suppose this is a problem related with how it works as previosly my clients had the same issue.
Transpiling the code to CommonJS would solve the issue.
Is this a cPanel hosting? I suppose this is a problem related with how it works as previosly my clients had the same issue.
Transpiling the code to CommonJS would solve the issue.
Yes cpanel hosting, i try change to commonJs but stuck in whatsapp.js
Line
const __dirname = path.dirname(fileURLToPath(import.meta.url))
do you have any suggestions?
You can just remove it since __dirname
should be available by default when using CommonJS.
thanks its running
You're welcome, closing this.
Hi, sorry I opened it again, the MD version is quite stable but I was confused when I changed it to common js
makeWASocket.default(config)
Log : (node:18936) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'default' of undefined
solved sorry need require like this const makeWASocket = require('@adiwajshing/baileys').default;
makeWASocket
bang ini cara biar bisa di hosting cpanel gimana ya, aku udah ubah ubah tetep aja error lognya begitu sama
I found this error when I was looking for a solution I had to add a type module in the json package but I see it already exists
Node js Version : 14.18.1
Log From hosting :