Expected: The dedupe command should work.
Actual: The dedupe command fails with Error: Assertion failed: The package (--locatorHash--) should have been registered
The command works if we remove the esbuild from the package.json. Looks like the npm alias @yarnpkg/builder has "esbuild": "npm:esbuild-wasm@^0.15.15" is causing this issue.
I was also experiencing this issue, and it seems like it only fails when user has actual stale resolution of esbuild, meaning this cannot be reliably reproduced unless user manually edits out the lockfile.
Self-service
Describe the bug
The
yarn dedupe
command fails withError: Assertion failed: The package (--locatorHash--) should have been registered
.To reproduce
Create a small package.json with
"dependencies": { "@yarnpkg/builder": "^3.3.0", "esbuild": "^0.15.18" }
Run
yarn
andyarn dedupe
.Expected: The dedupe command should work. Actual: The dedupe command fails with
Error: Assertion failed: The package (--locatorHash--) should have been registered
Environment
Additional context
The command works if we remove the
esbuild
from the package.json. Looks like the npm alias@yarnpkg/builder
has "esbuild": "npm:esbuild-wasm@^0.15.15" is causing this issue.