Skip to content

ReferenceError: io is undefined #2497

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

Closed
1 task done
z34 opened this issue Feb 9, 2017 · 1 comment
Closed
1 task done

ReferenceError: io is undefined #2497

z34 opened this issue Feb 9, 2017 · 1 comment

Comments

@z34
Copy link

z34 commented Feb 9, 2017

  • I understand that GitHub issues are not for tech support, but for questions specific to this generator, bug reports, and feature requests.
Item Version
generator-angular-fullstack 3.7.6
Node 6.9.5
npm 3.10.10
Operating System OS X 10
Item Answer
Transpiler TypeScript
Markup HTML
CSS LESS
Router ui-router
Client Tests Jasmine
DB MongoDB
Auth Y
Socket.io Y

After updating bower components and node modules, I started getting this error when pushing to Heroku:

screen shot 2017-02-08 at 3 24 03 pm

I'm really lost with what to do... I think this is coming from socket.service.ts, but I'm not sure what would have changed so that the library that provides io isn't attached after gulp build. I've gone to Heroku with no success, so I'm putting it here, hoping it's a bug in the package.json file and something needs to be rolled back? Like with #2479 which I also had happen at the same time. Any thoughts on anything I should try? Or is there a more correct place to go for help than here?

@z34
Copy link
Author

z34 commented Feb 9, 2017

This was not a bug with angular-fullstack... I am the bug. I don't understand how, but the socket.io-client library was removed, as @Awk34 suggested in another thread somewhere. index.html was initially looking for it here "/socket.io-client/socket.io.js", but that location wasn't copied when I ran gulp build, which explains why I only had a problem in production. I changed it to "bower_components/socket.io-client/socket.io.js" but that made it break both in production AND locally, which is when another thread #766 I found came to mind, suggesting socket.io-client was now in a dist folder. Now the source is "bower_components/socket.io-client/dist/socket.io.js" and that works. Thanks to @Awk34 and @xeroxoid

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

1 participant