chrisglein / artificial-chat

2 stars 1 forks source link

Fix warnings: new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method #77

Closed chrisglein closed 1 year ago

chrisglein commented 1 year ago

Problem Description

Cause is this: https://github.com/react-native-clipboard/clipboard/issues/116 Fix should look something like this: https://github.com/invertase/react-native-firebase/pull/5616/files#diff-c887076b0c80d540aed1bfbb472cc8f20516634e8e72d53014c65d690bba4fb1 Similar issue for reanimated: https://github.com/software-mansion/react-native-reanimated/issues/2297 And for netinfo: https://github.com/react-native-netinfo/react-native-netinfo/issues/486

Steps To Reproduce

Run app in debug mode. Get warnings on each run.

`new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method. 
    at Chat (http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true:148014:25)
    at AutomatedChatSession (http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true:156658:24)
    at ChatSession (http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true:156758:43)
    at RCTView
    at http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true:46747:44
    at App (http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true:96829:42)
    at RCTView
    at http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true:46747:44
    at RCTView
    at http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true:46747:44
    at AppContainer (http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true:46627:36)
    at ComponentWithDisplayName (http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true:84894:29)
registerWarning @ C:\Users\cglein\Source\artificial-chat\node_modules\react-native-windows\Libraries\LogBox\LogBox.js:148
`new NativeEventEmitter()` was called with a non-null argument without the required `removeListeners` method. 
    at Chat (http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true:148014:25)
    at AutomatedChatSession (http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true:156658:24)
    at ChatSession (http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true:156758:43)
    at RCTView
    at http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true:46747:44
    at App (http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true:96829:42)
    at RCTView
    at http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true:46747:44
    at RCTView
    at http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true:46747:44
    at AppContainer (http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true:46627:36)
    at ComponentWithDisplayName (http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true:84894:29)

Expected Results

No warnings.

App version

No response