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

Unable to resolve module react-native/Libraries/StyleSheet/ColorPropType.js #356

Open
topwebtek7 opened this issue Oct 15, 2018 · 24 comments

Comments

@topwebtek7
Copy link

Unable to resolve module react-native/Libraries/StyleSheet/ColorPropType.js in react-native-linear-gradient/index.ios.js and react-native-linear-gradient/index.android.js with latest React-Native v0.57.3

@radex
Copy link
Member

radex commented Oct 26, 2018

works for me. are you sure you don't have some stale yarn cache or something?

@topwebtek7
Copy link
Author

It works now. Thanks for fixing

@radex
Copy link
Member

radex commented Oct 30, 2018

I didn't do anything 😂

@radex radex closed this as completed Oct 30, 2018
@mjmasn
Copy link

mjmasn commented Nov 23, 2018

@radex in react-native@0.58-rc.0 that file has been moved to Libraries/DeprecatedPropTypes/DeprecatedColorPropType.js. Might need some conditional require to work with old and new versions 🤔

@mjmasn
Copy link

mjmasn commented Nov 23, 2018

ah, just saw the PR to remove the prop types, ignore me :)

@nwaughachukwuma
Copy link

Hey guys, @topwebtek and @radex, am having this issue in version 0.58.0 and have not been able to fix it. What could be responsible? I have done npm start -- --reset-cache yet, error persists. Any help will be appreciated

@frodoe7
Copy link

frodoe7 commented Feb 3, 2019

@nwaughachukwuma

copy this file

/node_modeuls/react-native/Libraries/DeprecatedPropTypes/DeprecatedColorPropType.js

to this location

/node_modeuls/react-native/Libraries/StyleSheet/

then rename it to ColorPropType.js (remove Deprecated)

this should fix the issue

@nwaughachukwuma
Copy link

OK thanks so much. But the problem is that I dont build locally. I use app center to automate my build process

@dlferro
Copy link

dlferro commented Feb 4, 2019

Definitely not a long term fix.

@Nualiian
Copy link

Nualiian commented Feb 5, 2019

yeah, not a longterm fix definitely. I tried upgrading to 0.58.3, seems to have fixed the bug, but it looks like it has some other bugs

@nwaughachukwuma
Copy link

Yeah, there's a lot of bugs in React Native 0.58.x (x<=3), and I raised an issue over that. Let's hope it becomes stable in the near future. Thanks so much

@KevinColemanInc
Copy link

@radex Should this issue be re-opened? That module has been deprecated.

@radex radex reopened this Feb 6, 2019
@radex
Copy link
Member

radex commented Feb 6, 2019

@KevinColemanInc You're right. PropTypes are dead, long live Flow types.

I started doing the work to remove PropTypes from this library in this PR: https://github.com/react-native-community/react-native-linear-gradient/pull/364/files

… but I don't have the time right now to finish it. @KevinColemanInc @nwaughachukwuma @Nualiian @dlferro @frodoe7 Is any of you willing to pick up the work? There's not much to do there… just clean up and test on iOS and Android that nothing is broken. Then we can merge it and release and update that will fix it once and for all

@ollyde
Copy link

ollyde commented Feb 7, 2019

Flow and PropTypes are dead. TypeScript is where it's at.

Anyhow, do we have a temporary fix that would fix build servers? Cannot copy stuff manually.
We updated 3 apps to 58 today :-|

@radex
Copy link
Member

radex commented Feb 8, 2019

@voidstarfire See the comment above. The fix is fairly straightforward — remove PropTypes altogether and copy over updated Flow types (see #364). Please send a qiuck PR and I will merge and release today if it looks good :)

@ollyde
Copy link

ollyde commented Feb 8, 2019

Heya thanks for the reply.

Production pipelines do things from scratch (IE, yarn install), I'd have to create a little script and add it to multiple steps :-D a lotta work. I just downgraded for now, RN 57.

I'm glad there's a PR waiting great :-)

@NrqhEIcsRi004
Copy link

With the update of RN, I hope to solve this problem as soon as possible.

@curiousdustin
Copy link

I'm having this issue as well. Is there still not a fix that doesn't require messing around with the react-native module files?

@csouth3
Copy link

csouth3 commented May 28, 2019

Yes, I'm eagerly anticipating this fix as well.

@curiousdustin
Copy link

This error disappeared once I upgraded to react-native 0.59.4 and react-native-linear-gradient 2.5.4

Should this be closed?

@csouth3
Copy link

csouth3 commented May 30, 2019

Looks like 2.5.4 works for me too

@mimamuh
Copy link

mimamuh commented Jun 13, 2019

Some for me, updated react-native-linear-gradient 2.4.4 to react-native-linear-gradient 2.5.4 and it works again.

@ziaulrehman40
Copy link

ziaulrehman40 commented Jun 18, 2019

Updating to 2.5.4 changed my error to:

error: bundling failed: Error: Unable to resolve module `./nativeLinearGradient` from `/Users/.../node_modules/react-native-linear-gradient/index.ios.js`: The module `./nativeLinearGradient` could not be found from `/Users/.../node_modules/react-native-linear-gradient/index.ios.js`. Indeed, none of these files exist:
  * `/Users/.../node_modules/react-native-linear-gradient/nativeLinearGradient(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
  * `/Users/.../node_modules/react-native-linear-gradient/nativeLinearGradient/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
    at ModuleResolver.resolveDependency (/Users/.../node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:163:15)
    at ResolutionRequest.resolveDependency (/Users/.../node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:52:18)
    at DependencyGraph.resolveDependency (/Users/.../node_modules/metro/src/node-haste/DependencyGraph.js:283:16)
    at Object.resolve (/Users/.../node_modules/metro/src/lib/transformHelpers.js:261:42)
    at dependencies.map.result (/Users/.../node_modules/metro/src/DeltaBundler/traverseDependencies.js:399:31)
    at Array.map (<anonymous>)
    at resolveDependencies (/Users/.../node_modules/metro/src/DeltaBundler/traverseDependencies.js:396:18)
    at /Users/.../node_modules/metro/src/DeltaBundler/traverseDependencies.js:269:33
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/.../node_modules/metro/src/DeltaBundler/traverseDependencies.js:87:24)

@lp4298707
Copy link

Updating to 2.5.4 changed my error to:

error: bundling failed: Error: Unable to resolve module `./nativeLinearGradient` from `/Users/.../node_modules/react-native-linear-gradient/index.ios.js`: The module `./nativeLinearGradient` could not be found from `/Users/.../node_modules/react-native-linear-gradient/index.ios.js`. Indeed, none of these files exist:
  * `/Users/.../node_modules/react-native-linear-gradient/nativeLinearGradient(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
  * `/Users/.../node_modules/react-native-linear-gradient/nativeLinearGradient/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)`
    at ModuleResolver.resolveDependency (/Users/.../node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:163:15)
    at ResolutionRequest.resolveDependency (/Users/.../node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:52:18)
    at DependencyGraph.resolveDependency (/Users/.../node_modules/metro/src/node-haste/DependencyGraph.js:283:16)
    at Object.resolve (/Users/.../node_modules/metro/src/lib/transformHelpers.js:261:42)
    at dependencies.map.result (/Users/.../node_modules/metro/src/DeltaBundler/traverseDependencies.js:399:31)
    at Array.map (<anonymous>)
    at resolveDependencies (/Users/.../node_modules/metro/src/DeltaBundler/traverseDependencies.js:396:18)
    at /Users/.../node_modules/metro/src/DeltaBundler/traverseDependencies.js:269:33
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/Users/.../node_modules/metro/src/DeltaBundler/traverseDependencies.js:87:24)

edit index.android.js and save , or delete all content of the index.android.js and recover , i fixed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests