Import socket.io with system.js
I am trying to include Aurelia frameworks in a project sockets.io
. I have sockets installed:
jspm install npm:socket.io
then I would like to import:
import {io} from "socket.io";
And the results:
GET http://localhost:9000/jspm_packages/npm/socket.io-client@1.3.5/package.js 404 (Not Found)
Where is the problem? Why is there a link to package.js
and not to package.json
or socket.io.js
?
+3
source to share
3 answers
I recently had problems downloading "socket.io-client" and found that
import io from 'socket.io-client';
var socket = io();
won't work as it tries to load socket_io_client.default
which is undefined. Instead, I had to use
import io = require('socket.io-client');
var socket = io();
-1
source to share