Viro: Unable to resolve module `react-native/Libraries/StyleSheet/StyleSheetPropType

Created on 22 Feb 2019  路  6Comments  路  Source: viromedia/viro

Environment

Please provide the following information about your environment:
ArchLinux kernel 4.19.23-1-lts
Samsung Galaxy S9 Android 8.0.0
"react-native": "^0.58.5", "react-viro": "2.13.0"

Description

Following the get started tutorial from on step 7 got the error that i show you on the image.

viroerror

To reproduce you just have to follow the get started tutorial. It's not working for me. Tried to solve the problem with the terminal output but didn't work.

Thank you.

Most helpful comment

Same issue for us

react-native : 0.58.5
react-viro : 2.13.0

I temporary resolved this issue commenting the following code + each PropTypes declaration in the following components

  • node_modules/react-viro/components/ViroParticleEmitter.js
  • node_modules/react-viro/components/ViroImage.js
  • node_modules/react-viro/components/ViroAnimatedImage.js
  • node_modules/react-viro/components/ViroFlexView.js
  • node_modules/react-viro/components/ViroSurface.js
  • node_modules/react-viro/components/ViroButton.js
  • ... (CTRL + F and search 'stylePropType' for to find these components)

var StyleSheetPropType = require('react-native/Libraries/StyleSheet/StyleSheetPropType')
var stylePropType = StyleSheetPropType(ViroPropTypes)

This is a workaround, consider downgrading react-native, *0.57.8 is fine*

All 6 comments

Same issue for us

react-native : 0.58.5
react-viro : 2.13.0

I temporary resolved this issue commenting the following code + each PropTypes declaration in the following components

  • node_modules/react-viro/components/ViroParticleEmitter.js
  • node_modules/react-viro/components/ViroImage.js
  • node_modules/react-viro/components/ViroAnimatedImage.js
  • node_modules/react-viro/components/ViroFlexView.js
  • node_modules/react-viro/components/ViroSurface.js
  • node_modules/react-viro/components/ViroButton.js
  • ... (CTRL + F and search 'stylePropType' for to find these components)

var StyleSheetPropType = require('react-native/Libraries/StyleSheet/StyleSheetPropType')
var stylePropType = StyleSheetPropType(ViroPropTypes)

This is a workaround, consider downgrading react-native, *0.57.8 is fine*

Seems these PropTypes and a few related classes were fully deprecated in recent releases of React. I think the replacement is a new package prop-types. More info:

In the meantime, I noticed that stubs of the old classes were moved to /react-native/Libraries/DeprecatedPropTypes. So in addition @Maxence-Machu's suggestion, another short term workaround is to copy/rename the necessary classes to the correct location, or modify the source to point to the deprecated versions. After going back-and-forth I determined there's about 6 classes that have to be moved.

I believe this is duplicate of #534. Viro is not compatible with newer versions of React/ReactNative, and that is the reason for the missing StyleSheetPropType and similar classes. Even after resolving these missing classes per previous comments, there are additional issues.

Hi @kaliatech, we are launching a new release shortly which will formally support React 0.59.

@VikAdvani How soon?

Viro 2.14 was released last week and supports RN 0.59.3. Release notes and upgrade instructions here -> https://docs.viromedia.com/docs/releases

Was this page helpful?
0 / 5 - 0 ratings