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

filesystem paths do not work in the browser #665

Closed
ajainvivek opened this issue Mar 10, 2016 · 4 comments
Closed

filesystem paths do not work in the browser #665

ajainvivek opened this issue Mar 10, 2016 · 4 comments
Labels

Comments

@ajainvivek
Copy link
Contributor

@ajainvivek ajainvivek commented Mar 10, 2016

  • WebTorrent version: latest
  • Node.js version: 4.0
  • Browser name/version (if using WebTorrent in the browser): Chrome/Electron

I am unable to seed the torrent file as it throws me an error "filesystem paths do not work in the browser". Electron as wrapped file system with path attribute after uploading file. Is there any way to get around this problem.

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Mar 11, 2016

Works fine for me in Electron. You must be changing what require('fs') returns somehow. Are you browserify the script? Or using webtorrent.min.js? Don't do that -- just use require('webtorrent').

The error you're seeing comes from this code in create-torrent:

    if (typeof fs.stat !== 'function') {
      throw new Error('filesystem paths do not work in the browser')
    }
@feross feross closed this Mar 11, 2016
@feross feross added the question label Mar 11, 2016
@ajainvivek

This comment has been minimized.

Copy link
Contributor Author

@ajainvivek ajainvivek commented Mar 11, 2016

I was using webtorrent.min.js. Thanks @feross .

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Mar 11, 2016

Glad you got it figured out :)

@lock

This comment has been minimized.

Copy link

@lock lock bot commented May 4, 2018

This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 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
2 participants
You can’t perform that action at this time.