Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module sockjs-client has no exported member "SockJS"

I am trying to import SockJS from the sockjs-client library. I am using Aurelia and typescript, but when trying to import that with

import { SockJS } from 'sockjs-client';

it says in VS2015: "Module sockjs-client has no exported member "SockJS""

package.json looks like this:

 "jspm": {
    "dependencies": {
     //......
  "sockjs": "npm:sockjs@^0.3.17",
  "sockjs-client": "npm:sockjs-client@^1.1.1",
  "stompjs": "npm:stompjs@^2.3.3",
},
"devDependencies": {}
}

Can anyone help?

like image 654
Stefan Avatar asked Sep 20 '16 14:09

Stefan


2 Answers

Try:

import SockJS = require('sockjs-client');
like image 143
Paleo Avatar answered Sep 28 '22 03:09

Paleo


Try to install sockjs-client typings npm install --save @types/sockjs-client and then import import * as SockJS from 'sockjs-client';

like image 40
Eugene Semenov Avatar answered Sep 28 '22 03:09

Eugene Semenov