Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not send files larger than +-60mb (Runtime.callFunctionOn timed out) #2413

Open
Divino67 opened this issue Nov 13, 2024 · 0 comments
Open
Labels
bug Something isn't working needs triage

Comments

@Divino67
Copy link

Divino67 commented Nov 13, 2024

Description

When I use the function client.sendFile(to, pathOrBase64, options?) to send a PDF file in base64, passing the "type" property as "document" in the options object, the file is not sent.

Before, I used the client.setLimit('maxFileSize',900857600) function to change the maximum file size to 900mb.

However, if I send a file larger than +-60mb, an error is returned and the file is not sent.

Maybe this is not an application error, if so, please forgive me and if you can, indicate the solution.

Environment

  • WPPConnect version(s): 1.35.1
  • WA-JS version(s): 3.14.0
  • Browser: Chrome 127.0.6533.119
  • OS: Linux Ubuntu 24.04.5 LTS
  • Node version: 18.20.4
  • WhatsApp version: 2.3000.1017390231
  • MultiDevice (BETA): no

Error returned

ProtocolError: Runtime.callFunctionOn timed out. Increase the 'protocolTimeout' setting in launch/connect calls for a higher timeout if needed.
    at <instance_members_initializer> (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:94:14)
    at new Callback (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:98:16)
    at CallbackRegistry.create (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/CallbackRegistry.js:23:26)
    at Connection._rawSend (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/Connection.js:90:26)
    at CdpCDPSession.send (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/CDPSession.js:66:33)
    at #evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:363:50)
    at ExecutionContext.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/ExecutionContext.js:278:36)
    at IsolatedWorld.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/cdp/IsolatedWorld.js:100:30)
    at CdpFrame.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Frame.js:346:43)
    at CdpFrame.<anonymous> (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/util/decorators.js:109:27)

Code used to set the maximum file upload limit

client.setLimit('maxFileSize', 900857600);

Code used to send the file

const file = 'data:application/pdf;base64,JVBERi0xLjMKMyAwIG9ia...'

await client.sendFile('[email protected]', file, {
            type: 'document',
            caption: '',
            filename: 'pdf_file.pdf'
            mimetype: 'application/pdf',
            markIsRead: false,
        }).then(resp => resp).catch(err => {
                console.log(err);
                throw err;
            });
@Divino67 Divino67 added bug Something isn't working needs triage labels Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant