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

Cannot read properties of undefined (reading 'code') #125

Closed
marcus-pousette opened this issue Apr 14, 2023 · 2 comments
Closed

Cannot read properties of undefined (reading 'code') #125

marcus-pousette opened this issue Apr 14, 2023 · 2 comments
Labels
question Further information is requested

Comments

@marcus-pousette
Copy link
Contributor

marcus-pousette commented Apr 14, 2023

Running the browser-to-browser example when using a VPN yields following error when connecting to ther other browsers address through the circuit relay.

transport-manager.ts:126 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'code')
    at DefaultTransportManager.dial (transport-manager.ts:126:15)
    at async DialRequest.dialAction (index.ts:350:14)
    at async dial-request.ts:100:18
    at async Promise.any (:5173/index 0)
    at async DialRequest.run (dial-request.ts:85:14)
    at async DefaultDialer.createDialTarget (index.ts:210:26)
    at async DefaultDialer.dial (index.ts:173:12)
    at async DefaultConnectionManager.openConnection (index.ts:504:26)
    at async Libp2pNode.dial (libp2p.ts:369:12)
    at async window.connect.onclick (index.js:114:22)

The dial error is not thrown when I am not behind a VPN and the example works as expected.

Expected behaviour (?). If establishing direct connection with WebRTC fails (because of the VPN), the example should still work nevertheless as I expected the relay would act as a TURN server, or there should be an error message of some sort.

@marcus-pousette
Copy link
Contributor Author

marcus-pousette commented Apr 29, 2023

this is the issue, should be something like (?)

promise.reject(errCode(new Error("failed to establish connection"),"ERR_FAILED_TO_ESTABLISH_CONNECTION"))

@maschad maschad added the question Further information is requested label May 2, 2023
@achingbrain
Copy link
Member

That was the issue, rejecting without passing a reason/error.

Fixed in #160

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
Archived in project
Development

No branches or pull requests

3 participants