oblador / react-native-progress

Progress indicators and spinners for React Native
MIT License
3.63k stars 516 forks source link

Cannot read 'hex' of undefined #214

Open sclavijo93 opened 4 years ago

sclavijo93 commented 4 years ago

Hi, I'm getting this error when importing * as Progress in my app

import * as Progress from 'react-native-progress';
.
.
.
 <Progress.Bar progress={0.3} width={200} />
Error: Requiring module "node_modules/@react-native-community/art/lib/Group.js", which threw an exception: TypeError: Cannot read property 'hex' of undefined.

TypeError: Cannot read property 'hex' of undefined

React Native: 0.63 Progress: 4.1.2 Art: 1.2.0

spyshower commented 4 years ago

same

RakshithD commented 4 years ago

Facing the same issue.

cheepion commented 4 years ago

i' m add yarn add @react-native-community/art and use the other components like Progress.Circle it's work for me

CXZ7720 commented 4 years ago

https://github.com/oblador/react-native-progress/issues/214#issuecomment-726568864

@Tankbt 's solution works nicely!!

My environments are

"react": "16.13.1", "react-native": "0.63.3",

sagarshakya commented 3 years ago

Linking ReactNative ART by running react-native link @react-native-community/art solved the issue for me.

gandarain commented 3 years ago

i' m add yarn add @react-native-community/art and use the other components like Progress.Circle it's work for me

This solution not working for me, any idea?

I get error, when I running my test file

TypeError: Cannot read property 'hex' of undefined

I am using Progress.Bar like this,

<Progress.Bar borderRadius={0} progress={timer === 3 ? 0.2 : timer === 2 ? 0.5 : 0.9} width={responsiveWidth(100)} color={color.thema} />

My environments are

"react-native": "^0.63.2",
"react-native-progress": "^4.1.2",
"@react-native-community/art": "^1.2.0",
chamaldesilva commented 3 years ago

i' m add yarn add @react-native-community/art and use the other components like Progress.Circle it's work for me

This solution not working for me, any idea?

I get error, when I running my test file

TypeError: Cannot read property 'hex' of undefined

I am using Progress.Bar like this,

<Progress.Bar borderRadius={0} progress={timer === 3 ? 0.2 : timer === 2 ? 0.5 : 0.9} width={responsiveWidth(100)} color={color.thema} />

My environments are

"react-native": "^0.63.2",
"react-native-progress": "^4.1.2",
"@react-native-community/art": "^1.2.0",

same error

TheFrostage commented 3 years ago

Don't forget to install pods for ios after installing react-native-art. I didn't see that setup step in the docs but it is required.

tareqdayya commented 3 years ago

Fixed by downgrading @react-native-community/art to 1.1.0

mcraigie commented 3 years ago

I got this message when I forgot to do a pod install after adding ReactNativeART (yarn add @react-native-community/art)

$ cd ~/Workspace/AppName
$ npx pod-install ios
npx: installed 1 in 3.023s
Scanning for pods...
1.9.3
> pod install
...
Analyzing dependencies
Downloading dependencies
Installing ReactNativeART (1.2.0)
Generating Pods project
Integrating client project
Pod installation complete! There are # dependencies from the Podfile and # total pods installed.
LukeAveil commented 2 years ago

any solution to this?

I get the same error when running Jest.

Tried the all the above but nothing works