danielcardeenas/sulla

CreateWid undefined (send image)

rodriguesabner opened this issue · 2 comments

Hi guys!! I'm having an error sending an image, the other requests work without problems...

async function send_image(req, res) {
    const { phone, caption, pathimage } = req.body

    //whatsapp = client...
    await whatsapp.sendImage(
        phone + "@c.us", //phone
        pathimage, //path
        'image-api.jpg', //image name
        caption //msg (caption)
    );

    res.status(200).json({
        caption: caption,
        phone: phone + "@c.us",
        pathimage: pathimage
    })
}

error:

(node:16828) UnhandledPromiseRejectionWarning: Error: Evaluation failed: TypeError: Cannot read property 'createWid' of undefined
    at w (C:\Users\Abner\NodeProjects\Whatsapp\node_modules\sulla\dist\lib\wapi\wapi.js:1:19525)
    at Object.window.WAPI.sendImage (C:\Users\Abner\NodeProjects\Whatsapp\node_modules\sulla\dist\lib\wapi\wapi.js:1:32227)
    at __puppeteer_evaluation_script__:3:38
.............

same issue, sorry

#347