Unable to resolve module react-native/Libraries/Components/View/ViewStylePropTypes

10,085

Solution 1

Had same issue.

As I find out expo 32.0.5 and react-native 0.58.3 are not compatible. So expo react-native fork should be used.

To install it you can use command

npm install --save react-native@https://github.com/expo/react-native/archive/sdk-32.0.1.tar.gz

Solution 2

You have to read the error-message carefully. I've the same issue, mine was:

Unable to resolve module react-native/Libraries/Components/View/ViewStylePropTypes from /APP/node_modules/react-native-render-html/src/HTMLUtils.js: Module react-native/Libraries/Components/View/ViewStylePropTypes does not exist in the Haste module map

So the 3rd Party Library react-native-render-html cause the error, because it try to use ViewStylePropTypes.

In case of @adrian-moisa: For you it's react-native-reanimated. Don't know what the cause was for the ThreadOpener, he didn't post an usable error-message.

Fact is, that ViewStylePropTypes was removed up from react-native 0.58

compare: https://github.com/facebook/react-native/tree/v0.57.8/Libraries/Components/View https://github.com/facebook/react-native/tree/v0.58.0/Libraries/Components/View

So the solution is to figure out, which 3rd-Party Component cause the error, and look if there is an upgrade from the maintainer, or yourself have to patch it (e.g. with patch-package)

Share:
10,085

Related videos on Youtube

Rockwell Momo
Author by

Rockwell Momo

Updated on June 30, 2022

Comments

  • Rockwell Momo
    Rockwell Momo almost 2 years

    This is my package.json:

    {
      "name": "BStore",
      "version": "0.0.1",
      "private": true,
      "scripts": {
        "start": "node node_modules/react-native/local-cli/cli.js start",
        "test": "jest"
      },
      "dependencies": {
        "expo": "^32.0.5",
        "native-base": "^2.11.0",
        "prop-types": "^15.7.2",
        "react": "16.6.3",
        "react-native": "0.58.3",
        "react-native-gesture-handler": "^1.0.15",
        "react-native-paper": "^2.11.0",
        "react-navigation": "^3.0.9",
        "react-navigation-material-bottom-tabs": "^1.0.0"
      },
      "devDependencies": {
        "babel-core": "7.0.0-bridge.0",
        "babel-jest": "24.1.0",
        "jest": "24.1.0",
        "metro-react-native-babel-preset": "0.51.1",
        "react-test-renderer": "16.6.3"
      },
      "jest": {
        "preset": "react-native"
      }    
    }
    

    I am getting this error Unable to resolve modulereact-native/Libraries/Components/View/ViewStylePropTypes`

    any ideas how can I solve this issue?

    • Adrian Moisa
      Adrian Moisa about 5 years
      Stop downvoting. I have the same issue on "react-native": "0.58.4" -> Error: Unable to resolve module react-native/Libraries/Components/View/ViewStylePropTypes` from C:\Projects\some-project-name\node_modules\react-native-rean‌​imated\src\createAni‌​matedComponent.js: Module react-native/Libraries/Components/View/ViewStylePropTypes does not exist in the Haste module map`
  • Dan Cancro
    Dan Cancro about 5 years
    I get this error with expo 32.0.6 and [email protected], and I get another error with the react-native fork which uses [email protected]. Is there any good combination of versions of expo, react-native, and babel-core? My package.json looks like gist.github.com/dancancro/8f43d9d50716520ec57276ac122e6d93
  • Sasha Kos
    Sasha Kos about 5 years
    Im using expo 32.0.6 and react-native github.com/expo/react-native/archive/sdk-32.0.1.tar.gz