Strange socket.io.js error on client side

I'm getting these strange error during my attempts to get socket.io working.

Console

Also, my socket.io.js file appears like this in chrome:

weird error

I know my socket.io.js file does not have this within it.

My client code is as follow:

// Set up sockets
var socket = io.connect();

socket.on('statusMessage', function(data){
    console.log(data.message);
});

My server code is as follows

var serv_io = io.listen(server);
serv_io.sockets.on('connection', function(socket){
    socket.emit('statusMessage', {'message': 'Succesfully connected to serve via   sockets'});
});

I am also requiring socket.io in a simple way:

var io = require('socket.io');

I am also deploying on Heroku.

Why is this happening?

I found out my error. And it was a very simple error. I wasn't including socket.io.js properly on my HTML file.

When using the socket.io library, the client side JavaScript doesn't need to be manually downloaded and included. You own node.js server actually serves it.

I just had to include:

<script src = "/socket.io/socket.io.js"></script>