nodejs-mobile / nodejs-mobile-react-native

Node.js for Mobile Apps React Native plugin
https://nodejs-mobile.github.io
MIT License
180 stars 42 forks source link

Issue on react native #71

Open kusaljr opened 8 months ago

kusaljr commented 8 months ago

ERROR Warning: Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Likely causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.

Error message:

TypeError: _nodejsMobileReactNative.default.channel.removeListener is not a function (it is undefined)


  React.useEffect(() => {
    listener.addListener("pub", handleNodeMessage);
    nodejs.channel.post('pub', 'Hello from react-native!')

    return () => {
      listener.removeListener("pub", handleNodeMessage);
    };
  }, []);
clydee-geng commented 2 months ago

I also encountered the same problem

staltz commented 2 months ago

Please provide the output of npx react-native info.

clydee-geng commented 2 months ago

Please provide the output of npx react-native info.请提供npx react-native info的输出。

warn Package @ant-design/icons-react-native contains invalid configuration: "dependency.assets" is not allowed. Please verify it's properly linked using "npx react-native config" command and contact the package maintainers about this. info Fetching system and libraries information... System: OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa) CPU: (4) x64 AMD Ryzen 9 5900HX with Radeon Graphics Memory: 5.26 GB / 15.58 GB Shell: version: 5.0.17 path: /bin/bash Binaries: Node: version: 18.2.0 path: ~/.nvm/versions/node/v18.2.0/bin/node Yarn: Not Found npm: version: 8.9.0 path: ~/.nvm/versions/node/v18.2.0/bin/npm Watchman: Not Found SDKs: Android SDK: Not Found IDEs: Android Studio: Not Found Languages: Java: version: 17.0.12 path: /usr/bin/javac Ruby: Not Found npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.73.1 wanted: 0.73.1 npmGlobalPackages: "react-native": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: true newArchEnabled: false

info React Native v0.75.3 is now available (your project is running on v0.73.1). info Changelog: https://github.com/facebook/react-native/releases/tag/v0.75.3 info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.75.3 info For more info, check out "https://reactnative.dev/docs/upgrading?os=linux".