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

Webtorrent in Meteor fails when loaded via NPM. Not via CDN #804

Closed
FinnFrotscher opened this issue May 16, 2016 · 3 comments
Closed

Webtorrent in Meteor fails when loaded via NPM. Not via CDN #804

FinnFrotscher opened this issue May 16, 2016 · 3 comments
Labels

Comments

@FinnFrotscher
Copy link

@FinnFrotscher FinnFrotscher commented May 16, 2016

When I import the webtorrent package via import WebTorrent from 'webtorrent' and try to set up the package with var client = new WebTorrent() I get

tcp-pool.js:22 Uncaught TypeError: net.createServer is not a function

But when I use $.ajax() to load the CDN hosted version it works.

This is both clientside running Meteor 1.3.

  • WebTorrent version: newest NPM version
  • Node.js version: Meteor 1.3 is 0.10.43
  • Browser name/version (if using WebTorrent in the browser): Chrome, newest

Add
When I use meteor npm and import, and then console.log(webtorrent) I get the function back and i also have the required files. index.js starts with:

module.exports = WebTorrent
//stuff
function WebTorrent (opts) {
var self = this
if (!(self instanceof WebTorrent)) return new WebTorrent(opts)
EventEmitter.call(self)`
//asf...

but i cant use it.

@feross feross added the question label May 16, 2016
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented May 16, 2016

I did some digging and it looks like Meteor doesn't support the "browser" field in package.json fully, so it's not properly replacing the needed files with browser versions during the packaging process.

I left a comment on the relevant Meteor issue for you. meteor/meteor#6890 You can follow that issue, or share more information there to help the Meteor devs prioritize the issue.

@feross feross closed this May 16, 2016
@l3maire

This comment has been minimized.

Copy link

@l3maire l3maire commented Apr 11, 2017

@FinnFrotscher seems like the issue hasn't been fixed yet on Meteor side. Have you found a temporary solution? Did you keep it via CDN? Thanks

@lock

This comment has been minimized.

Copy link

@lock lock bot commented May 3, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 3, 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.