Seb
Seb

Reputation: 1118

How to load Awesome-websocket library in Aurelia

I tried to use awesome-websocket in Aurelia, but at loading, I got an error!
I added the dependency to package.json file :

"jspm": {    
  "dependencies": {
     .....
     "awesome-websocket": "npm:awesome-websocket@^0.0.25",
     .....
   },
   .....
}

and add import :

import {AweWebsocket} from 'awesome-websocket';

but I have this error at loading the page :

Error: XHR error (404 Not Found) loading http://localhost:9000/jspm_packages /npm/awesome-websocket@0.0.25/src/awesome-websocket.litcoffee.js
Error loading http://localhost:9000/jspm_packages/npm/awesome-websocket@0.0.25/src/awesome-websocket.litcoffee.js as "./src/awesome-websocket.litcoffee" from http://localhost:9000/jspm_packages/npm/awesome-websocket@0.0.25/index.js
Stack trace:
o@http://localhost:9000/jspm_packages/system.js:4:12694
e/http://localhost:9000/jspm_packages/system.js:4:13219

What is the problem ?
Any ideas ?

Best regards

Upvotes: 0

Views: 604

Answers (2)

Joey
Joey

Reputation: 456

If you still want to use this package.

Try:

jspm install npm:awesome-websocket

Find the jspm_packages/npm/awesome-websocket@0.0.25 directory.

The content of .js files (including src folder) need to modify the word .itcoffee to .js.

Upvotes: 0

Jeremy Danyow
Jeremy Danyow

Reputation: 26406

The awesome-websocket package doesn't contain a fully compiled javascript module. It's built with coffescript and intended to be used with browserify. Both jspm install npm:awesome-websocket and jspm install github:glg/awesome-websocket have the same result- the installed package contains coffeescript files and a couple of js files that reference other coffeescript files.

I tried importing the file mentioned in the readme:

compiled

import {AwesomeWebSocket} from 'glg/awesome-websocket/test/www/js/awesome-websocket';

But this file also contains references to coffeescript files.

Upvotes: 0

Related Questions