Skip to content
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

Extension API requires a named function, e.g. function name() {} #214

Closed
alexandreramilo opened this issue Dec 20, 2014 · 2 comments
Closed

Extension API requires a named function, e.g. function name() {} #214

alexandreramilo opened this issue Dec 20, 2014 · 2 comments

Comments

@alexandreramilo
Copy link

@alexandreramilo alexandreramilo commented Dec 20, 2014

First of all, great job by the project! 👍

Issue:
In node-webkit:

var WebTorrent = require('webtorrent')
var client = new WebTorrent()

var magnet_uri = "magnet:...";
client.add(magnet_uri, function (torrent) {
    console.log('Torrent info hash:', torrent.infoHash)
});

Error:

Uncaught node.js Error 

Error: Extension API requires a named function, e.g. function name() {}
    at Wire.use (asdf\node_modules\webtorrent\node_modules\bittorrent-swarm\node_modules\bittorrent-protocol\index.js:130:11)
    at Torrent._onWire (asdf\node_modules\webtorrent\lib\torrent.js:421:42)
    at Swarm.EventEmitter.emit (events.js:104:17)
    at Swarm._onwire (asdf\node_modules\webtorrent\node_modules\bittorrent-swarm\index.js:594:8)
    at Swarm.<anonymous> (asdf\node_modules\webtorrent\node_modules\bittorrent-swarm\index.js:495:10)
    at Wire.EventEmitter.emit (events.js:115:17)
    at Wire._onHandshake (asdf\node_modules\webtorrent\node_modules\bittorrent-swarm\node_modules\bittorrent-protocol\index.js:328:8)
    at Wire.<anonymous> (asdf\node_modules\webtorrent\node_modules\bittorrent-swarm\node_modules\bittorrent-protocol\index.js:602:12)
    at Wire._write (asdf\node_modules\webtorrent\node_modules\bittorrent-swarm\node_modules\bittorrent-protocol\index.js:485:10)
    at doWrite (_stream_writable.js:262:12)

What am I doing wrong?

@twayz

This comment has been minimized.

Copy link

@twayz twayz commented Dec 21, 2014

I'm getting the same error

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Dec 22, 2014

This should be fixed now that webtorrent/ut_pex#2 has been merged. Sorry for the error!

@feross feross closed this Dec 22, 2014
@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.