How to import socket.io via brocfile for ember cli application?

独自空忆成欢 提交于 2019-12-11 09:54:21

问题


I want to use socket.io in my ember cli application, so I installed with:

bower install socket.io --save

And added the following line to my Brocfile.js:

app.import('bower_components/socket.io/index.js');

This results in two errors in my browser console:

Uncaught ReferenceError: module is not defined
Uncaught Error: Could not find module ember-moment/helpers/moment

Any ideas?


回答1:


Ended up using socket.io-client which imports without errors.

app.import('bower_components/socket.io-client/socket.io.js');


来源:https://stackoverflow.com/questions/29025058/how-to-import-socket-io-via-brocfile-for-ember-cli-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!