react-native: undefined is not a function(evaluating '_this.registerEvents()')
- [X ] Review the documentation: https://facebook.github.io/react-native
- [X ] Search for existing issues: https://github.com/facebook/react-native/issues
- [X ] Use the latest React Native release: https://github.com/facebook/react-native/releases
Environment
React Native Environment Info:
System:
OS: Windows 10
CPU: x64 Intel(R) Core(TM) i5-7300U CPU @ 2.60GHz
Memory: 757.11 MB / 7.93 GB
Binaries:
Yarn: 1.9.4 - C:\Users\ecumb\AppData\Roaming\npm\yarn.CMD
npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.1.0.0 AI-173.4907809
Description
Reproducible Demo
Create RN project using react-native init using version 0.57.0-rc0 react-native run-android kill the spawned bundler and relaunch using npm start to work around issue #20712
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 9
- Comments: 47 (13 by maintainers)
Seems like rc-3 solves the issue
I have this exact error.
Worth mentioning that it’s because i’m on 57-rc0 to escape the acessiblity bug in 56
Also worth mentioning that I’m here because 56 is the default configuration in webstorm.
Whats a stable version of react-native I can use to learn things?
Looks resolved.
I’m having this issue on any project with 0.57 rc3, starting from scratch or upgrading. I’m using macOS Mojave beta.
I do have this problem with rc2 (on macOS)
@haggholm had this issue
undefined is not a function(evaluating '_this.registerEvents()')
on0.57.0-rc.2
but now with the configuration in.babelrc
and0.57.0-rc.4
it works.I can confirm that this works with the latest
0.57 rc4
:package.json
.babelrc
I can also confirm some of @donjo9’s process. Here is what got me from a clean git repo to a working app:
react-native init MyApp2 --template typescript --version 0.57.0-rc.3
cd MyApp2
react-native upgrade
react-native run-android
At this point the bundler booted up, the app installed on the emulator, and I was able to debug via chrome dev tools. I will update this later tonight when I can test on a different computer.
Sorry for keep spamming, but this got me from a clean git clone to a working app
git clone https://github.com/joejordan/0.57rc3-WindowsCrash Test057rc3
cd Test057rc3
npm install
react-native upgrade
answering y to every question Installwith the Android SDK manager
react-native run-android
this will still fail kill bundlerreact-native start --reset-cache
From this point on
react-native run-android
should work@joejordan Your
.babelrc
is wrong. If you have other questions, please try create a new project and make some diff in case you miss something. It should be:Try deleting
node_modules/.cache
, and then doingreact-native start --resetCache
Is this still a problem with rc2 ? because i used to have this issue, but dont with rc2