react-native: "Expected a constructor" error on app launch

🐛 Bug Report

Getting the following error on launching app in debug mode: IMG_1644

Expected Behavior

The app should run normally. It does not cause any problem when run a release build.

Environment

React Native Environment Info: System: OS: macOS 10.14.4 CPU: (4) x64 Intel® Core™ i5-5350U CPU @ 1.80GHz Memory: 27.63 MB / 8.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 11.11.0 - /usr/local/bin/node Yarn: 1.15.2 - /usr/local/bin/yarn npm: 6.7.0 - /usr/local/bin/npm SDKs: iOS SDK: Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2 Android SDK: API Levels: 23, 25, 26, 27, 28 Build Tools: 23.0.1, 25.0.0, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.2, 28.0.3 System Images: android-21 | Google APIs Intel x86 Atom_64, android-25 | Google APIs Intel x86 Atom, android-26 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom IDEs: Android Studio: 3.3 AI-182.5107.16.33.5314842 Xcode: 10.2/10E125 - /usr/bin/xcodebuild npmPackages: react: 16.8.3 => 16.8.3 react-native: 0.59.4 => 0.59.4 npmGlobalPackages: create-react-native-app: 2.0.2 react-native-cli: 2.0.1 react-native-create-library: 3.1.2

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 25 (1 by maintainers)

Most upvoted comments

I found the problem. The problem was with "react-redux": "7.0.0". In this version connect has been implemented as a functional react component. Due to which the babel @ decorators that I used for my project was not working with connect. This caused was the cause of this issue, closing this now.

对此有任何修复吗?我不使用redux,而是使用mobx,它使用各种装饰器,所以我认为它都是同样的问题…?

Hi ,I think it is a mobx-react version problem. I will fall back to v5.4.3 and it will be solved.

@liganghui Yes rollback to previous version of mobx-react (v5.4.3) solved this.

was not working with connect

How did you solved this? i would like to keep decorators. did you rollback to a previous version?

Thanks

“react-redux” not recommend using connect as a decorator, because the spec is unstable.

was not working with connect

How did you solved this? i would like to keep decorators. did you rollback to a previous version?

Thanks

Go back to react-redux 6.0.0

I came here to see “Hey guys! I’ve just achieved to use some decorator. Just type yarn add some-magic-stuff”

I am crying right now.

** Music starts ** source

facing the same problem, can this issue be resolved ?

same problem with redux 😦

facing the same problem.