yarnpkg / yarnpkg/berry

[Bug] running `patch-commit` for a package that has a builtin patch fails

Open
#4,441 7 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug upholded
Dominant language
TypeScript
Stars
8.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Running patch-commit for a package that has a builtin patch now fails with

Internal Error: Assertion failed: Expected the resolution to have been registered
    at PatchCommitCommand.execute (/berry/packages/plugin-patch/sources/commands/patchCommit.ts:82:15)  
    at PatchCommitCommand.validateAndExecute (/berry/.yarn/__virtual__/clipanion-virtual-6f45223597/0/cache/clipanion-npm-3.2.0-rc.4-8470d16306-c9d8ba9e16.zip/node_modules/clipanion/lib/advanced/Command.js:67:26)
    at Cli.run (/berry/.yarn/__virtual__/clipanion-virtual-6f45223597/0/cache/clipanion-npm-3.2.0-rc.4-8470d16306-c9d8ba9e16.zip/node_modules/clipanion/lib/advanced/Cli.js:149:24)
    at Cli.runExit (/berry/.yarn/__virtual__/clipanion-virtual-6f45223597/0/cache/clipanion-npm-3.2.0-rc.4-8470d16306-c9d8ba9e16.zip/node_modules/clipanion/lib/advanced/Cli.js:158:28)
    at exec (/berry/packages/yarnpkg-cli/sources/main.ts:148:7)
    at run (/berry/packages/yarnpkg-cli/sources/main.ts:48:7)

Originally posted by @merceyz in https://github.com/yarnpkg/berry/issues/4218#issuecomment-1072905294

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/plugin-patch/sources/commands/patchCommit.ts around line 82, then reproduce the patch-commit command with a package that has a builtin patch. Trace why the resolution is not registered and verify that the command completes without the assertion failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.