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

patch-package should ignore files defined in yarnclean file #564

Open
jennifer-shehane opened this issue Apr 4, 2025 · 0 comments
Open

Comments

@jennifer-shehane
Copy link

jennifer-shehane commented Apr 4, 2025

I'm running into an error running patch-package on a specific package. I noticed that the patch file removes a README.md file. This is due to my .yarnclean file defining *.md files for removal. So, I believe yarn install is running - removing the markdown file, then patch-package is running and becoming confused with the removal of the md file somehow?

Removing the *.md line from my .yarnclean file caused the patch to be successful: cypress-io/cypress@38469fd

I think .yarnclean is not playing well with patch-package. Maybe this should be updated to ignore files similar to how .gitignore` directories are ignored?

writeFileSync(join(tmpRepo.name, ".gitignore"), "!/node_modules\n\n")

Error

CI error: https://app.circleci.com/pipelines/github/cypress-io/cypress/69268/workflows/ac2b9f29-e0fd-4d4c-b837-a4bc75b0a860/jobs/2847547

**ERROR** Failed to apply patch for package snap-shot-core at path
  
    node_modules/snap-shot-core

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

    patches/snap-shot-core+10.2.4.dev.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 snap-shot-core
  
  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
    

---
patch-package finished with 1 error(s).
node:child_process:966
    throw err;
    ^

Error: Command failed: patch-package && lerna run rebuild-better-sqlite3 --scope @packages/server

You can see how the PR diff including removing the Readme file: https://github.com/cypress-io/cypress/pull/31449/files#diff-6d4ec7fb70a72c8193e10a8c390b904e6313087e19b3d2a191d466cc31063441

This seemed to work on other patches I made though - like here - so I'm not sure why this one failed.

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

1 participant