feross / feross/simple-peer

Bug: Electron process exited with code 1

Open
#866 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.8k
Forks
983
PR merge metrics
No merged PRs in 30d

Description

**What version of this package are you using?**

9.11.0

**What operating system, Node.js, and npm version?**

OS: Debian

NodeJS: v16.13.1

NPM: 8.1.2

**What happened?**

Copy-pasting from https://github.com/webtorrent/webtorrent/issues/2230 as the response is that it's a problem with this lib.

I wrote a [client to help reseed peertube videos](https://gitlab.com/NamingThingsIsHard/media_tools/peertube-reseed/-/tree/b4beba28a4954d9404d3504ac8ba91a6f52a1952), but unfortunately I'm not able to get it to work because webtorrent just crashes before seeding can start.

- "webtorrent": "^1.5.8"
- "webtorrent-hybrid": "^1.0.6"

The project has a docker image that recreates the problem. Run `docker-compose up prod`
```
prod_1 |
prod_1 | > peertube-reseed-js@0.0.1 start
prod_1 | > ./index.js "https://tilvids.com"
prod_1 |
prod_1 | Creating target directory /tmp/peertube-reseed/
prod_1 | /app/node_modules/simple-peer/index.js:129
prod_1 | this._pc.peerIdentity.catch(err => {
prod_1 | ^
prod_1 |
prod_1 | TypeError: Cannot read properties of null (reading 'catch')
prod_1 | at new Peer (/app/node_modules/simple-peer/index.js:129:29)
prod_1 | at WebSocketTracker._createPeer (/app/node_modules/bittorrent-tracker/lib/client/websocket-tracker.js:413:18)
prod_1 | at generateOffer (/app/node_modules/bittorrent-tracker/lib/client/websocket-tracker.js:379:47)
prod_1 | at WebSocketTracker._generateOffers (/app/node_modules/bittorrent-tracker/lib/client/websocket-tracker.js:372:7)
prod_1 | at WebSocketTracker.announce (/app/node_modules/bittorrent-tracker/lib/client/websocket-tracker.js:63:12)
prod_1 | at Socket. (/app/node_modules/bittorrent-tracker/lib/client/websocket-tracker.js:44:14)
prod_1 | at Object.onceWrapper (node:events:509:28)
prod_1 | at Socket.emit (node:events:402:35)
prod_1 | at Socket._handleOpen (/app/node_modules/simple-websocket/index.js:202:10)
prod_1 | at WebSocket.Socket._ws.onopen (/app/node_modules/simple-websocket/index.js:77:36)
```

**What did you expect to happen?**

Connections to the peertube server to be successful and to start seeding videos.

**Are you willing to submit a pull request to fix this bug?**

Unfortunately not. There's not enough time to get into Chromium and WebRTC. I can contribute whatever logs are necessary to debug.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.