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

Patching Git modules without version #497

Open
tim-elmer opened this issue Oct 22, 2023 · 3 comments
Open

Patching Git modules without version #497

tim-elmer opened this issue Oct 22, 2023 · 3 comments

Comments

@tim-elmer
Copy link

I'm attempting to patch a package distributed via Git (Antora's default UI) that doesn't have a version number in its package.json. Not terribly surprisingly, patch-package isn't thrilled about this:

...\node_modules\patch-package\dist\makePatch.js:395
        throw e;
        ^

TypeError: Cannot read properties of undefined (reading 'replace')
    at Object.getPackageVersion (...\node_modules\patch-package\dist\getPackageVersion.js:6:51)
    at Object.makePatch (...\node_modules\patch-package\dist\makePatch.js:111:52)
    at ...\node_modules\patch-package\dist\index.js:72:25
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (...\node_modules\patch-package\dist\index.js:71:22)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)

Node.js v18.18.0

I've attempted explicitly installing the package by commit ID to no avail. Am I missing something, or is this currently not supported?

If not, I'd like to request that support be added. I'd expect patch-package to patch against the current "version" (in this case, the provided or default Git branch) if no version information is available.

@tim-elmer
Copy link
Author

It may be worth noting that this issue should eventually be addressed for my particular usecase by https://gitlab.com/antora/antora-ui-default/-/issues/211, but I'd still expect patch-package to handle missing version info more gracefully.

@sesm
Copy link

sesm commented Nov 15, 2023

@tim-elmer one way to fix it would be to make a patch for patch-package itself, like this: #203 (comment)

@tim-elmer
Copy link
Author

@tim-elmer one way to fix it would be to make a patch for patch-package itself, like this: #203 (comment)

While I certainly appreciate that flexibility, I unfortunately don't understand what's going on within patch-package well enough to fix this myself. I did some digging when I initially realized what was going on, but wasn't able to coax it into ignoring the lack of a version.

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

2 participants