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

Invalid asm.js: Expected function name #1830

Closed
yuri-karadzhov opened this issue Apr 12, 2020 · 6 comments
Closed

Invalid asm.js: Expected function name #1830

yuri-karadzhov opened this issue Apr 12, 2020 · 6 comments

Comments

@yuri-karadzhov
Copy link

What version of this package are you using?
webtorrent@0.108.1

What operating system, Node.js, and npm version?
MacOS Catalina 10.15.4
Node.js v12.16.1
npm 6.13.4

What happened?
Some (but not all) torrent links (that work with instant.io) does not work with basic example given a warning in console Invalid asm.js: Expected function name. Seems like an old issue with minification #281 and #1252

What did you expect to happen?
I would expect all magnet links will work the same way they do in instant.io

@alxhotel
Copy link
Member

Hi @yuri-karadzhov, thanks for the feedback :)

Can you give some examples of working and not working magnet links ?

@yuri-karadzhov
Copy link
Author

yuri-karadzhov commented Apr 12, 2020 via email

@yuri-karadzhov
Copy link
Author

@alxhotel I spot the difference, instant.io adds &tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com to the end of the link. I tried it and it starts working. Am I missing some part of API that searches for additional torrents or this list is known and hardcoded?

@XayOn
Copy link

XayOn commented Apr 19, 2020

That's a common feature on most bittorrent clients, adding trackers.
You could use magnet-uri to parse the magnet link and add the trackers ( wss://tracker.bttorrent.xyz, wss:tracker.fastcast.nz and wss:tracker.openwebtorrent.com ).

I use something like this:

import magnet from 'magnet-uri';
let torrent_origin = "magnet:...."
let decoded = magnet.decode(torrent_origin)
decoded['tr'].push('wss://tracker.openwebtorrent.com')
let torrent_origin = magnet.encode(decoded);

If you use webtorrent-desktop, you could also grab the magnet link from it, as it adds the trackers automatically.

@stale
Copy link

stale bot commented Nov 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Nov 2, 2020
@feross feross removed the wontfix label Nov 4, 2020
@feross
Copy link
Member

feross commented Nov 11, 2020

Invalid asm.js: Expected function name is a harmless warning that Firefox sometimes emits. See: #1252

The right place to fix is in the upstream babel-minify project

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants