Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EventEmitter Module doesn't exist Error #51

Open
bhatti-waqas opened this issue Oct 17, 2017 · 13 comments
Open

EventEmitter Module doesn't exist Error #51

bhatti-waqas opened this issue Oct 17, 2017 · 13 comments

Comments

@bhatti-waqas
Copy link

I get following error when try to add the toast.
Please help out.
simulator screen shot 17-oct-2017 10 28 12 am

@xapm
Copy link

xapm commented Oct 18, 2017

临时解决方案:
修改node_modules/react-native-root-siblings/lib/AppRegistryInjection.js
将import EventEmitter from 'react-native/Libraries/EventEmitter/EventEmitter';
改为import EventEmitter from 'react-native/Libraries/vendor/emitter/EventEmitter';
备注:RN的这个版本移动了emitter包的位置

@bhatti-waqas
Copy link
Author

But How can I modify in native library??

@Morriz
Copy link

Morriz commented Oct 18, 2017

@magicismight Please make your root siblings module work with RN 0.48+, so we don't have to fork your stuff and create confusion. It will also be the answer to this bug report :)

@kevando
Copy link

kevando commented Oct 29, 2017

For the non chinese folks like me, @zylibin solution worked for me:

Find the file node_modules/react-native-root-siblings/lib/AppRegistryInjection.js

And replace line: import EventEmitter from 'react-native/Libraries/EventEmitter/EventEmitter';
With import EventEmitter from 'react-native/Libraries/vendor/emitter/EventEmitter';

@Morriz
Copy link

Morriz commented Oct 29, 2017 via email

@beansoft
Copy link

please use my fork in your package.json, this might be the most easy solution, just a work around:

"react-native-root-toast": "github:pilipa-cn/react-native-root-toast#v2.2.0"

@Albinzr
Copy link

Albinzr commented Dec 4, 2017

Is there any official fix for this?

@Morriz
Copy link

Morriz commented Dec 4, 2017

No, like @beansoftapp offered, and what more people are doing, which leads to a lot of (unmaintained) forks: fork your own, or use somebody else's fork (like @beansoftapp's)

That is why, ultimately, most open source advocates will gently keep nudging the original maintainer to update the package. So pretty please @magicismight ?

@beansoft
Copy link

beansoft commented Dec 4, 2017

I totally agree with @Morriz, so i'd like to talk how to fix this issue without touch the original source code at all. This bug occured as the author has specific the dependencies like this:

"dependencies": {
        "react-native-root-siblings": "^1.2.1"
    }

so the ^ will not lock the version of react-native-root-siblings, but the author released another new version of react-native-root-siblings which only works on latest react native. If you are using RN 0.46 ~ 0.48, you can run yarn first, then edit the yarn.lock file, and commit this file to your code base and other team member will using the same version as you, they just need do run a yarn. Now search and edit version number to this:

react-native-root-siblings@^1.2.1:
  version "1.2.1"
  resolved "https://registry.yarnpkg.com/react-native-root-siblings/-/react-native-root-siblings-1.2.1.tgz#6f8d0e711dbf9aef4e57e73aea751372b5aefcff"
  dependencies:
    static-container "^1.0.0"

react-native-root-toast@^1.1.2:
  version "1.1.2"
  resolved "https://registry.yarnpkg.com/react-native-root-toast/-/react-native-root-toast-1.1.2.tgz#1f5a2dad70743a9ab6b5d44674c8dda578523961"
  dependencies:
    react-native-root-siblings "^1.2.1"

in package.json:
"react-native-root-toast": "1.1.2"
Then you must run yarn again, this will make sure your local node_modules using the correct version.

@Morriz
Copy link

Morriz commented Dec 4, 2017 via email

@magicismight
Copy link
Owner

magicismight commented Dec 5, 2017

For react-native >= 0.47 you can use react-native-root-toast@2.2.0, or using 1.2.1 for lower version.

@beansoft
Copy link

beansoft commented Dec 5, 2017

@magicismight so it might be kindly enough for you to add supported RN version range in the readme file. In fact this issue was first found after Nov 25, our CI breaks nightly build, after that I added yarn.lock file to our code base.

@asnad
Copy link

asnad commented Jun 13, 2018

Any proper solution found?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants