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

Creating patch file for GitHub dependency fails #335

Closed
OmgImAlexis opened this issue Jul 17, 2021 · 5 comments · Fixed by #444
Closed

Creating patch file for GitHub dependency fails #335

OmgImAlexis opened this issue Jul 17, 2021 · 5 comments · Fixed by #444

Comments

@OmgImAlexis
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.

Closes #288

Here is the diff that solved my problem:

diff --git a/node_modules/patch-package/dist/getPackageResolution.js b/node_modules/patch-package/dist/getPackageResolution.js
index bc7ffaa..287a2f1 100644
--- a/node_modules/patch-package/dist/getPackageResolution.js
+++ b/node_modules/patch-package/dist/getPackageResolution.js
@@ -65,7 +65,7 @@ function getPackageResolution({ packageDetails, packageManager, appPath, }) {
         lockFileStack.reverse();
         const relevantStackEntry = lockFileStack.find((entry) => entry.dependencies && packageDetails.name in entry.dependencies);
         const pkg = relevantStackEntry.dependencies[packageDetails.name];
-        return pkg.resolved || pkg.from || pkg.version;
+        return pkg.resolved || pkg.version || pkg.from;
     }
 }
 exports.getPackageResolution = getPackageResolution;

This issue body was partially generated by patch-package.

@QuentinFarizon
Copy link

Thanks, stumbled on the same issue, this works well !

@ds300 could you merge this ?

@shoes22
Copy link

shoes22 commented Nov 3, 2021

This fixed my problem as well! Please merge into main repo!

@mtwomey
Copy link

mtwomey commented May 17, 2022

+1 Please merge.

@dijonkitchen
Copy link
Contributor

Might want to make a pull request for this to merge. This is just an issue.

@bastienlm
Copy link

Works for me, thanks :)

@orta orta closed this as completed in #444 Dec 28, 2022
@orta orta closed this as completed in fb14417 Dec 28, 2022
stianjensen pushed a commit to stianjensen/patch-package that referenced this issue Apr 26, 2023
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

Successfully merging a pull request may close this issue.

6 participants