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

[BUG] "Cannot destructure property 'creds' of 'authState' as it is undefined" while trying to create a socket #1190

Open
fidalgobr opened this issue Jan 4, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@fidalgobr
Copy link

Describe the bug
Title

To Reproduce
Steps to reproduce the behavior:

  1. Try to create a connection.

Expected behavior
The connection should be created.

Environment (please complete the following information):

  • Is this on a server? No
  • What do your connectOptions look like? {
    printQRInTerminal: true
    }
  • Do you have multiple clients on the same IP? No
  • Are you using a proxy? No

Additional context
Node 22.11.0

@fidalgobr fidalgobr added the bug Something isn't working label Jan 4, 2025
@ramdhanymf
Copy link

I think you missed the auth configuration during initialization, it should be look like this

import makeWASocket, {useMultiFileAuthState} import "@whiskeysockets/baileys";

const { state, saveCreds } = await useMultiFileAuthState("baileys_auth_info");
const sock = makeWASocket({
    printQRInTerminal: true,
    auth: {
      creds: state.creds,
    },
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@ramdhanymf @fidalgobr and others