react-native: [0.57] _this._registerEvents is not a function on a clean project
- Review the documentation: https://facebook.github.io/react-native
- Search for existing issues: https://github.com/facebook/react-native/issues
- Use the latest React Native release: https://github.com/facebook/react-native/releases
Environment
$ react-native info
React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Memory: 520.12 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.11.3 - ~/.nvm/versions/node/v8.11.3/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 5.6.0 - ~/.nvm/versions/node/v8.11.3/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
IDEs:
Xcode: 10.0/10L232m - /usr/bin/xcodebuild
npmPackages:
react: 16.5.0 => 16.5.0
react-native: 0.57.0 => 0.57.0
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
Description
Bumped an existing 0.56.1 project to 0.57 and encountered an error on simulator start: _this._registerEvents is not a function on a clean project. Tried a new project from scratch and got the same error. Running Xcode 10 Beta.
Same error was mentioned in the following ticket: #20712
_this._registerEvents is not a function. (In '_this._registerEvents()', '_this._registerEvents' is undefined)
WebSocket
index.bundle?platform=ios&dev=true&minify=false:24147:28
connectToDevTools
index.bundle?platform=ios&dev=true&minify=false:26078:62
<unknown>
index.bundle?platform=ios&dev=true&minify=false:25863:38
loadModuleImplementation
index.bundle?platform=ios&dev=true&minify=false:262:14
<unknown>
index.bundle?platform=ios&dev=true&minify=false:19771:20
loadModuleImplementation
index.bundle?platform=ios&dev=true&minify=false:262:14
guardedLoadModule
index.bundle?platform=ios&dev=true&minify=false:150:47
global code
index.bundle?platform=ios&dev=true&minify=false:81797:4
****
Reproducible Demo
xcode-select -s /Applications/Xcode-beta.app/Contents/Developer
react-native init AwesomeProject
cd AwesomeProject
node_modules/.bin/react-native run-ios
EDIT: Tried another new project and it worked this time. I guess it must be related to caching issues.
Will reopen if I can reliably reproduce.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 25
- Comments: 25 (1 by maintainers)
#20567 by kelset
it has been 1,5 year that I am coding with react-native. what i learned in this long time.
'cause all I have is these fc.g bugs with no solution.
react-native start --reset-cache worked for me on @hbicexp solution
got the same issue.
my react-native version is “0.59.4” and have same issue
Never mind. The problem was fixed but after about 30 mins it’s back and this time the above solution is not working. I even tried
gradlew cleanandnpm cache clean.Update: I removed everything from
.babelrcand left an empty object and now the app works perfectly. Even after ~1.8 years of development in react-native, I have no idea about what is going on. :\We updated to React Native 0.57.4 and @babel/core 7.1.2 and our problem went away.
I’m also facing this issue on version 0.60.5
Error screenshot
react-native info:
package.json
babel.config.js
I tried: https://github.com/facebook/react-native/issues/21094#issuecomment-422245589 https://github.com/facebook/react-native/issues/21094#issuecomment-435597536 https://github.com/facebook/react-native/issues/21094#issuecomment-504986169 None worked.
Solution:
I removed ‘react-native’ from my babel.config.js and added a parenthesis on the render of App.js instead of making it an object.
Changed it from:
to
Facing the same issue.
Tried all the methods mentioned above. This is the output of my react-native info
package.json
Try commenting out
setupDevtoolsin setUpDeveloperTools. I still haven’t found the underlying issue, but since all I want to upgrade my old project, I will postpone the investigation.@HuanDay I need to execute it on Android emulator!! I have already tried multiple times: react-native start – --reset-cache.
Did anyone found a solution for this? I am facing the issue for a while now! Cant make new projects cause they show the same error… 😕