Skip to content

TypeError: Cannot read property 'trim' of undefined #495

Open
@frxstrem

Description

@frxstrem

I'm trying to use node-irc 0.5.2 to connect to an IRC server (running ircd.js 0.0.17 with default configuration). This is the code I'm using:

import irc from 'irc';

const client = new irc.Client('localhost', 'TestBot', {
  debug: true,
  channels: [ '#bottest' ],
});

However, I get this exception:

27 Dec 00:03:32 - Sending irc NICK/USER
27 Dec 00:03:32 - SEND: NICK TestBot
27 Dec 00:03:32 - SEND: USER nodebot 8 * :nodeJS IRC client
27 Dec 00:03:32 - SEND: WHOIS TestBot
27 Dec 00:03:32 - SEND: JOIN #bottest
/home/fredrik/usr/ircbot/node_modules/irc/lib/irc.js:849
                        throw err;
                        ^

TypeError: Cannot read property 'trim' of undefined
    at Client.<anonymous> (/home/fredrik/usr/ircbot/node_modules/irc/lib/irc.js:414:80)
    at emitOne (events.js:96:13)
    at Client.emit (events.js:188:7)
    at iterator (/home/fredrik/usr/ircbot/node_modules/irc/lib/irc.js:846:26)
    at Array.forEach (native)
    at Socket.handleData (/home/fredrik/usr/ircbot/node_modules/irc/lib/irc.js:841:15)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions