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

Issue in react-native-vector-icons, need to apply patch with 10.1.0 version #1632

Open
sjkushwaha21 opened this issue Jul 5, 2024 · 4 comments
Labels
waiting Waiting on OP response

Comments

@sjkushwaha21
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-vector-icons/android/.project b/node_modules/react-native-vector-icons/android/.project
new file mode 100644
index 0000000..5b2e34b
--- /dev/null
+++ b/node_modules/react-native-vector-icons/android/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>react-native-vector-icons</name>
+	<comment>Project react-native-vector-icons created by Buildship.</comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
+	</natures>
+	<filteredResources>
+		<filter>
+			<id>1716794798985</id>
+			<name></name>
+			<type>30</type>
+			<matcher>
+				<id>org.eclipse.core.resources.regexFilterMatcher</id>
+				<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
+			</matcher>
+		</filter>
+	</filteredResources>
+</projectDescription>
diff --git a/node_modules/react-native-vector-icons/android/bin/src/main/java/com/oblador/vectoricons/VectorIconsModuleImpl.class b/node_modules/react-native-vector-icons/android/bin/src/main/java/com/oblador/vectoricons/VectorIconsModuleImpl.class
new file mode 100644
index 0000000..2a5207e
Binary files /dev/null and b/node_modules/react-native-vector-icons/android/bin/src/main/java/com/oblador/vectoricons/VectorIconsModuleImpl.class differ
diff --git a/node_modules/react-native-vector-icons/android/bin/src/main/java/com/oblador/vectoricons/VectorIconsPackage.class b/node_modules/react-native-vector-icons/android/bin/src/main/java/com/oblador/vectoricons/VectorIconsPackage.class
new file mode 100644
index 0000000..79146ea
Binary files /dev/null and b/node_modules/react-native-vector-icons/android/bin/src/main/java/com/oblador/vectoricons/VectorIconsPackage.class differ
diff --git a/node_modules/react-native-vector-icons/android/bin/src/newarch/java/com/oblador/vectoricons/VectorIconsModule$Errors.class b/node_modules/react-native-vector-icons/android/bin/src/newarch/java/com/oblador/vectoricons/VectorIconsModule$Errors.class
new file mode 100644
index 0000000..212fbc1
Binary files /dev/null and b/node_modules/react-native-vector-icons/android/bin/src/newarch/java/com/oblador/vectoricons/VectorIconsModule$Errors.class differ
diff --git a/node_modules/react-native-vector-icons/android/bin/src/newarch/java/com/oblador/vectoricons/VectorIconsModule.class b/node_modules/react-native-vector-icons/android/bin/src/newarch/java/com/oblador/vectoricons/VectorIconsModule.class
new file mode 100644
index 0000000..0664dfb
Binary files /dev/null and b/node_modules/react-native-vector-icons/android/bin/src/newarch/java/com/oblador/vectoricons/VectorIconsModule.class differ
diff --git a/node_modules/react-native-vector-icons/android/bin/src/oldarch/java/com/oblador/vectoricons/VectorIconsModule$Errors.class b/node_modules/react-native-vector-icons/android/bin/src/oldarch/java/com/oblador/vectoricons/VectorIconsModule$Errors.class
new file mode 100644
index 0000000..0e47952
Binary files /dev/null and b/node_modules/react-native-vector-icons/android/bin/src/oldarch/java/com/oblador/vectoricons/VectorIconsModule$Errors.class differ
diff --git a/node_modules/react-native-vector-icons/android/bin/src/oldarch/java/com/oblador/vectoricons/VectorIconsModule.class b/node_modules/react-native-vector-icons/android/bin/src/oldarch/java/com/oblador/vectoricons/VectorIconsModule.class
new file mode 100644
index 0000000..77e02f1
Binary files /dev/null and b/node_modules/react-native-vector-icons/android/bin/src/oldarch/java/com/oblador/vectoricons/VectorIconsModule.class differ
diff --git a/node_modules/react-native-vector-icons/lib/object-utils.js b/node_modules/react-native-vector-icons/lib/object-utils.js
index d03b55b..712b89b 100644
--- a/node_modules/react-native-vector-icons/lib/object-utils.js
+++ b/node_modules/react-native-vector-icons/lib/object-utils.js
@@ -17,4 +17,4 @@ const omit = (obj, ...keysToOmit) => {
     }, {});
 };
 
-module.exports = { pick, omit };
+export { omit, pick };

This issue body was partially generated by patch-package.

@sjkushwaha21 sjkushwaha21 changed the title Issue in react-native-vector-icons, need to apply patch with 8.0.0 version Issue in react-native-vector-icons, need to apply patch with 10.1.0 version Jul 5, 2024
@johnf
Copy link
Collaborator

johnf commented Jul 5, 2024

@sjkushwaha21 What problem did this solve for you?

@johnf johnf added the waiting Waiting on OP response label Jul 5, 2024
@sjkushwaha21
Copy link
Author

Hi @johnf,

Changing
module.exports = { pick, omit };
To
export { omit, pick };

Helped my issue.

@david-gettins
Copy link

Hi @johnf,

Changing module.exports = { pick, omit }; To export { omit, pick };

Helped my issue.

You could clean up your patch file by only including:

diff --git a/node_modules/react-native-vector-icons/lib/object-utils.js b/node_modules/react-native-vector-icons/lib/object-utils.js
index d03b55b..712b89b 100644
--- a/node_modules/react-native-vector-icons/lib/object-utils.js
+++ b/node_modules/react-native-vector-icons/lib/object-utils.js
@@ -17,4 +17,4 @@ const omit = (obj, ...keysToOmit) => {
     }, {});
 };
 
-module.exports = { pick, omit };
+export { omit, pick };

But, this looks more like a config issue you can solve here without having to patch, CJS/ESM thing. module.exports is for CJS modules which are pulled into other code via require. export is for ESM modules, which are pulled in via import.

It would be good to know what your issue was not just the fix.

@sjkushwaha21
Copy link
Author

sjkushwaha21 commented Jul 9, 2024

Hi @johnf, @david-gettins

I am facing following issue. Please find the attachment as you requested.

Screenshot 2024-07-09 at 5 11 56 PM

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

No branches or pull requests

3 participants