Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
fix: use simple-peer fork that does not throw when setting error codes (
Browse files Browse the repository at this point in the history
#231)

* fix: use simple-peer fork that does not throw when setting error codes

Uses a [temporary fork](https://github.com/ipfs-shipyard/simple-peer)
of simple-peer with feross/simple-peer#686
applied so it does not throw when trying to override the `.code` property
of [DOMExceptions](https://developer.mozilla.org/en-US/docs/Web/API/DOMException)

Fixes these sorts of errors:

```
        Error: Uncaught TypeError: Cannot assign to read only property 'code' of object '' (file:/home/travis/build/libp2p/js-libp2p-webrtc-star/node_modules/simple-peer/index.js:26)
```

* chore: update package.json

Co-authored-by: Jacob Heun <[email protected]>

Co-authored-by: Jacob Heun <[email protected]>
  • Loading branch information
achingbrain and jacobheun authored Jun 25, 2020
1 parent c07ac28 commit 5795435
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@
"ipfs-utils": "^2.3.0",
"it-pipe": "^1.0.1",
"libp2p-utils": "^0.1.0",
"libp2p-webrtc-peer": "^9.7.2",
"mafmt": "^7.0.1",
"menoetius": "0.0.2",
"minimist": "^1.2.0",
"multiaddr": "^7.1.0",
"p-defer": "^3.0.0",
"peer-id": "~0.13.12",
"prom-client": "^12.0.0",
"simple-peer": "^9.6.0",
"socket.io": "^2.3.0",
"socket.io-client": "^2.3.0",
"stream-to-it": "^0.2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const errcode = require('err-code')
const withIs = require('class-is')

const { AbortError } = require('abortable-iterator')
const SimplePeer = require('simple-peer')
const SimplePeer = require('libp2p-webrtc-peer')
const { supportsWebRTC: webrtcSupport } = require('ipfs-utils/src/supports')

const multiaddr = require('multiaddr')
Expand Down
2 changes: 1 addition & 1 deletion src/listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ log.error = debug('libp2p:webrtc-star:listener:error')
const multiaddr = require('multiaddr')

const io = require('socket.io-client')
const SimplePeer = require('simple-peer')
const SimplePeer = require('libp2p-webrtc-peer')
const pDefer = require('p-defer')

const toConnection = require('./socket-to-conn')
Expand Down

0 comments on commit 5795435

Please sign in to comment.