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

Uncaught ReferenceError: io is not defined #111

Closed
Schnodderbalken opened this issue Nov 29, 2016 · 5 comments
Closed

Uncaught ReferenceError: io is not defined #111

Schnodderbalken opened this issue Nov 29, 2016 · 5 comments

Comments

@Schnodderbalken
Copy link

Schnodderbalken commented Nov 29, 2016

I had ember-websockets running, everything was fine. Then I wanted to run my ember application on another device. There I got the following error in the browser:

socket-io.js:12 Uncaught ReferenceError: io is not defined at Class.createSocket (http://localhost:4200/assets/vendor.js:85187:25) at Class.socketFor (http://localhost:4200/assets/vendor.js:85253:31) ...

In the line
var newSocketIO = io(url, options);

I was wondering why it worked on my initial device. So I removed the node_modules folder and then it occurred there as well.

When I enter ember install ember-websockets
I get
Installed packages for tooling via npm. installing ember-websockets install package mock-socket Installed packages for tooling via npm. install bower package urijs cached https://github.com/LearnBoost/socket.io-client.git#1.7.1 cached https://github.com/medialize/URI.js.git#1.18.3 Installed browser packages via Bower. Installed addon package.

ember g socket-io

returns

installing socket-io install bower package socket.io-client cached https://github.com/medialize/URI.js.git#1.18.3 cached https://github.com/LearnBoost/socket.io-client.git#1.7.1

So it seems that everything is installed properly.

I would have thought that ember-websocket takes care of resolving the dependency to socket-io itself so that I don't have to do something manually. What do I have to do in order to resolve that issue?

@thoov
Copy link
Owner

thoov commented Nov 30, 2016

Thanks @Schnodderbalken for opening this issue. The socket.io-client library which ember-websockets uses was updated and the location of the file was changed without my knowledge. I have a PR (#116) which will hopefully fix this and will push a new version out once its merged.

@thoov
Copy link
Owner

thoov commented Nov 30, 2016

Can you try version 6.2.1 and see if that fixes your issue?

@Schnodderbalken
Copy link
Author

Well, somehow I still get the above mentioned error. I changed the package.json entry to "ember-websockets": "6.2.1". I removed all cached npm and bower modules and re-installed them. Still no success :-(

@thoov
Copy link
Owner

thoov commented Nov 30, 2016

@Schnodderbalken My fix in #116 included the wrong path (my mistake). I have now fixed it in #117 and push a release 6.2.2. I verified that io was found so this issue should now be fixed. Can you check one last time. Thanks!

@Schnodderbalken
Copy link
Author

Now it works. Thanks for your quick reaction :) 👍

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

2 participants