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

TypeError: require(...).getViewManagerConfig is not a function #23171

Closed
hyochan opened this issue Jan 27, 2019 · 4 comments
Closed

TypeError: require(...).getViewManagerConfig is not a function #23171

hyochan opened this issue Jan 27, 2019 · 4 comments
Labels
Bug Resolution: Locked This issue was locked by the bot.

Comments

@hyochan
Copy link
Contributor

hyochan commented Jan 27, 2019

Environment

React Native Environment Info:
    System:
      OS: macOS 10.14
      CPU: (4) x64 Intel(R) Core(TM) i7-6660U CPU @ 2.40GHz
      Memory: 1.86 GB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.5.0 - ~/.nvm/versions/node/v10.5.0/bin/node
      Yarn: 1.7.0 - ~/.nvm/versions/node/v10.5.0/bin/yarn
      npm: 6.4.1 - ~/.nvm/versions/node/v10.5.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        API Levels: 21, 22, 23, 24, 25, 26, 27, 28
        Build Tools: 23.0.1, 23.0.3, 25.0.0, 25.0.2, 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.2, 27.0.3, 28.0.2, 28.0.3
        System Images: android-28 | Google APIs Intel x86 Atom
    IDEs:
      Android Studio: 3.3 AI-182.5107.16.33.5199772
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.3 => 16.6.3 
      react-native: 0.58.1 => 0.58.1 
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7
      react-native-webview: 3.2.1

Description

Run jest will throw below error in [email protected]+ in flow project (typescript project is ok).

TypeError: require(...).getViewManagerConfig is not a function

Reproducible Demo

  1. git clone https://github.com/hyochan/talktalk-rn.git.
  2. npm install.
  3. git checkout ReactNative0.58.1.
  4. run jest -u.
@kelset
Copy link
Contributor

kelset commented Jan 28, 2019

Can you reproduce this issue in a fresh react-native init project?

@hyochan
Copy link
Contributor Author

hyochan commented Jan 29, 2019

@kelset I believe it would be the same since js side code will be same. If you'd like for me to try this out, it may take time because I have to move all configs and codes to new project.

P.S.
react-native init TestJest keep failing and stuck but react-native init test is fine (well this one I'll post up in a new issue soon).

@hyochan
Copy link
Contributor Author

hyochan commented Feb 3, 2019

@kelset I've found the solution. I had to mock like below in previous react-native version when using react-navigation@3 after react-native-gesture-handler newly added.

NativeModules.UIManager = {
  RCTView: () => ({
    directEventTypes: {},
  }),
};

When I remove above, everything works fine.

@hyochan hyochan closed this as completed Feb 3, 2019
@Kida007
Copy link
Contributor

Kida007 commented Mar 2, 2019

Hey @hyochan, Im still getting the errors testing a project with latest react-navigation/react-native-gesture-handler versions.

    TypeError: Cannot read property 'State' of undefined

      at Object.<anonymous> (node_modules/react-native-gesture-handler/GestureHandler.js:54:36)
      at Object.<anonymous> (node_modules/react-native-gesture-handler/Swipeable.js:11:23)
      at Object.<anonymous> (node_modules/react-native-gesture-handler/index.js:1:525)

and if add try to tweak Native-Modules , i get the above error . Cant find a way To get jest work with
react-native-gesture-handler.

@facebook facebook locked as resolved and limited conversation to collaborators Feb 3, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Feb 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants