ds300 / patch-package

Fix broken node modules instantly 🏃🏽‍♀️💨
MIT License
10.17k stars 283 forks source link

Failed to apply patch for package react-native at path node_modules/react-native #523

Open yding-aptos-com opened 2 months ago

yding-aptos-com commented 2 months ago

The "Use of bitwise '|' with boolean operands" error is fixed in React Native 0.69+. But we are currently using react-native 0.63.5, we have to apply the following patch to fix the issue in node_modules when buiding circle-CI:

react-native+0.63.5.patch:

@@ -24,6 +24,28 @@ index c17c76d..9d5aaaf 100644 } } } diff --git a/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp b/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp index d916a45..1c7207a 100644 --- a/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp +++ b/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp @@ -2282,7 +2282,7 @@ static float YGDistributeFreeSpaceSecondPass( depth, generationCount); node->setLayoutHadOverflow(

=======================

But when this patch is being applied in circle-CI build, I kept getting the following error:

ERROR Failed to apply patch for package react-native at path

node_modules/react-native

This error was caused because patch-package cannot apply the following patch file:

patches/react-native+0.63.5.patch

Try removing node_modules and trying again. If that doesn't work, maybe there was an accidental change made to the patch file? Try recreating it by manually editing the appropriate files and running:

patch-package react-native

If that doesn't work, then it's a bug in patch-package, so please submit a bug report. Thanks!

https://github.com/ds300/patch-package/issues
TheScalion commented 1 month ago

I am facing fame issue in react-native-0.73.8 for replacing this line in "react-native/third-party-podspecs/boost.podspec" file

spec.source = { :http => 'https://sourceforge.net/projects/boost/files/boost/1.76.0/boost_1_76_0.tar.bz2', :sha256 => 'f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41' }

but in react native 0.68.2 i have same patch and it's woking.

diff --git a/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp b/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp index 9986279..20389d4 100644 --- a/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp +++ b/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.cpp @@ -2229,7 +2229,7 @@ static float YGDistributeFreeSpaceSecondPass( depth, generationCount); node->setLayoutHadOverflow(