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

io is not defined #127

Open
adaptivedev opened this issue Oct 29, 2015 · 3 comments
Open

io is not defined #127

adaptivedev opened this issue Oct 29, 2015 · 3 comments

Comments

@adaptivedev
Copy link

There was a suggestion here: #77

  • make sure you have socket.io client library: bower install socket.io-client --save

This didn't fix my problem with this same error.

  • including in index.html:
    script src="lib/angular-socket-io/socket.js"
  • in app.js
    angular.module('starter', ['ionic', 'starter.controllers', 'starter.services', 'starter.directives', 'btford.socket-io'])
  • in services.js

.factory('seatStatusSocket',function(socketFactory){
var myIoSocket = io.connect(porturl); // io is not defined here, suddenly.

  • It was working before, using a remote copy of the lib. When this error started, I changed index.html to link a local copy, as this remote version also received a Bad Gateway error (now fine, but still socket io is not defined as above).

  • removed: script src="http://chat.socket.io/socket.io/socket.io.js"

  • versions

    [email protected] node_modules/socket.io
    node --version
    v0.12.7

@azachar
Copy link

azachar commented Feb 2, 2016

The solution is described here: http://stackoverflow.com/questions/33411413/angular-socket-io-io-is-not-defined

@Diegow3b
Copy link

Worked for me when i changed io('local...) to io.connect('local...) and declare the io "declare var io"

@AzRu
Copy link

AzRu commented Nov 28, 2016

Happening for me now too. Was also working before.

I have socket.io client library added (1.4.8), I've done what's in the above stackoverflow solution, using the io.connect approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants