tmcdos / custompatch

Tool for patching buggy NPM packages without forking them
Other
17 stars 2 forks source link

Not working with scoped packages #1

Closed nikita-fuchs closed 2 weeks ago

nikita-fuchs commented 1 year ago

Hey, found this package in search for an alternative for patch-package, but unfortunately I'm getting the same issues here:

$ custompatch @strapi/plugin-users-permissions

CustomPatch version 1.0.21
Creating patch for: @strapi/plugin-users-permissions
Fetching tarball of @strapi/plugin-users-permissions from undefined
....nvm/versions/node/v18.12.1/lib/node_modules/custompatch/node_modules/npm-package-arg/npa.js:34
  const nameEndsAt = arg[0] === '@' ? arg.slice(1).indexOf('@') + 1 : arg.indexOf('@')
                        ^

TypeError: Cannot read properties of undefined (reading '0')
    at npa (....nvm/versions/node/v18.12.1/lib/node_modules/custompatch/node_modules/npm-package-arg/npa.js:34:25)
    at Object.extract (....nvm/versions/node/v18.12.1/lib/node_modules/custompatch/node_modules/pacote/extract.js:32:10)
    at fetchPackage (....nvm/versions/node/v18.12.1/lib/node_modules/custompatch/index.js:173:10)
    at makePatch (....nvm/versions/node/v18.12.1/lib/node_modules/custompatch/index.js:161:35)
    at Object.<anonymous> (....nvm/versions/node/v18.12.1/lib/node_modules/custompatch/index.js:76:5)

I would be very thankful for a fix!

tmcdos commented 1 year ago

Can you please share your package.json so I can reproduce the issue?

nikita-fuchs commented 1 year ago
  "dependencies": {
    "@strapi/plugin-graphql": "4.5.5",
    "@strapi/plugin-i18n": "4.5.5",
    "@strapi/plugin-users-permissions": "4.5.5",
    "@strapi/provider-email-sendgrid": "^4.5.5",
    "@strapi/strapi": "4.5.6",
    "dayjs": "^1.11.7",
    "pg": "8.6.0"
  }
tmcdos commented 1 year ago

The fix was applied and a new version has been published on NPM. Please check and report back if you face other issues.