-
Notifications
You must be signed in to change notification settings - Fork 506
Description
-
Version:
"@libp2p/tcp": "^10.0.19",
"libp2p": "^2.6.2",
"react-native-tcp-socket": "^6.2.0", -
Platform:
64-bit (Windows) -
Subsystem:
@libp2p/tcp
Severity:
Medium
Description:
In React Native 0.77.0, the following errors occur, making the TCP transport unusable. Previously, @libp2p/tcp appeared to work, as referenced in the repository: https://github.com/ipfs-shipyard/js-libp2p-react-native.
- Adding tcp() to the transports key in the createLibp2p functions generates the below error in Exhibit 1 below.
- Commit dd7b329, which introduced the code in Exhibit 2, causes react-native to fail as it defaults to the tcp.browser.js code.
Exhibit 1
TypeError: The listener must be a function at addListener (http://10.0.2.2:8081/node_modules\react-native-tcp-socket\node_modules\eventemitter3\index.bundle//&platform=android&lazy=true&app=com.reactnativep2p&modulesOnly=true&sourcePaths=url-server&dev=true&minify=false&runModule=true&shallow=true:61:26)
Exhibit 2
"browser": { "./dist/src/tcp.js": "./dist/src/tcp.browser.js" },
Steps to reproduce the error:
Create a react-native project, and add tcp() to the list of transports