Cannot read property 'connection' of undefined in client.connect()
See original GitHub issueActual behaviour: Using node-webkit v0.12.3 (Chromium 41.0.2272.76), when trying to use client.connect() after creating the client object with a set of options, an error is thrown - “Cannot read property ‘connection’ of undefined”
Expected behaviour: IRC client should connect without error
Error log:
var irc = require('tmi.js');
$scope.client = new irc.client({
options: {
debug: true
},
identity: {
username: $scope.username,
password: $scope.password
},
channels: [$scope.channel]
});
$scope.client.connect().then(function(data){
console.log('connection data...');
console.log(data);
}).catch(function(err){
console.log('connection error...');
console.log(err);
});
...
connection error...
Cannot read property 'connection' of undefined
Server configuration
- Operating system: Windows 7 x64
- Node version (if applicable): 5.8.0
- NPM version (if applicable): 3.7.3
- tmi.js version: 1.08
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
node.js - TypeError: Cannot read property 'connect' of undefined
Correct way var MongoClient = require('mongodb').MongoClient; // it's not a function. Your way var MongoClient = require('mongodb').
Read more >Cannot read property 'connection' of undefined #1227 - GitHub
I tried to install Ghost locally, but it kept giving me an error. Debug Information: OS: Ubuntu, v20.04 LTS Node Version: v12.18.0 Ghost...
Read more >How to resolve a 'cannot read property connect of undefined ...
You get this error because the variable object is not defined, and trying to retrieve, set or mutate the property “id” on undefined...
Read more >TypeError: Cannot read properties of undefined ... - MongoDB
I have this code here: import { MongoClient } from "mongodb"; const createConnection = () => { // let current = null; const...
Read more >Cannot Read Property of Undefined in JavaScript - Rollbar
TypeError : Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Haha, I forgot about it too! I actually did switch my project over to Electron a couple weeks ago and it worked perfectly without any modifications. Electron just seems a lot nicer than node-webkit anyways and doesn’t crash as much. So it isn’t an issue for me anymore!
Awesome 👍 Yeah it’s a lot better 😄