cjam / cjam/react-native-spotify-remote

Example NativeEventEmitter.js error (this._nativeModule.addListener is not a function)

Open
#232 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Objective-C
Stars
283
Forks
110
PR merge metrics
No merged PRs in 30d

Description

After cloning the repo and running the example/ code, I was greeted with the following error. This looks like an issue in the EventEmmiter library. This happens after following the `README.md` to set up the example project for the first time.

The app throws this error immediately when it starts up. I believe the library in question is being used by `SpotifyRemote.ts`. Everything was installed using yarn. I tried changing the react native version to no avail. This is being run on a physical iPhone device using Xcode on M2.

**Error**

--------------------------------------------------------------------------------
[Thu Feb 16 2023 17:24:40.607] ERROR TypeError: this._nativeModule.addListener is not a function. (In 'this._nativeModule.addListener(eventType)', 'this._nativeModule.addListener' is undefined)

This error is located at:
in AppContextProvider (at App.tsx:50)
in App (at renderApplication.js:45)
in RCTView (at View.js:34)
in View (at AppContainer.js:106)
in RCTView (at View.js:34)
in View (at AppContainer.js:132)
in AppContainer (at renderApplication.js:39)

[Thu Feb 16 2023 17:37:20.100] BUNDLE ./index.js

--------------------------------------------------------------------------------

**All code is default from master except for a couple changes**

**Podfile Includes** (Fix for [this issue](https://github.com/cjam/react-native-spotify-remote/issues/207))

`pod 'RNSpotifyRemote', :path => '../node_modules/react-native-spotify-remote'`
`pod 'RNEventEmitter', :path => "../node_modules/react-native-events"`

**Package.json dependencies**

"peerDependencies": {
"react-native": "0.60"
},
"dependencies": {
"react-native-spotify-remote": "1.0.0-1"
},
"devDependencies": {
"@release-it/keep-a-changelog": "^2.2.2",
"@types/react-native": "0.60.0",
"all-contributors-cli": "^6.14.2",
"concurrently": "^5.0.2",
"release-it": "^14.6.1",
"typedoc": "^0.20.24",
"typescript": "^4.1.3"
},

`platform :ios, '10.0'`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.