[Bug] Pnpify SDK generation errors out if eslint is not installed
envgap__yarnpkg__berry-448
Original GitHub issue ↗Opened 2019-09-10
01 / FAILURE SIGNATURE
As reported upstream
Error: A package is trying to access a peer dependency that should be provided by its direct ancestor but isn't
Not a benchmark task.
- No curated issue-specific recipe or verified environment fix is available.
02 / ENVIRONMENT RECIPE
- Base commit
Not freshly verified- Manifest
package.json- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
yarnpkg/berry #448 · read the original issue
**Describe the bug**
Pnpify SDK generation errors out if eslint is not installed
**To Reproduce**
```
$ yarn add @yarnpkg/pnpfiy
$ yarn pnpify --sdk
Error: A package is trying to access a peer dependency that should be provided by its direct ancestor but isn't
Required package: eslint (via "eslint/package.json")
Required by: @yarnpkg/pnpify@virtual:402e3d2070e057bc1180d1d078c776cf4354afb6d37c93585b0815585e67d99d546134f307b9b6f4fd5571ee37e4b3a0a2615e9ac1469dd97759c388c70244bb#npm:2.0.0-rc.3 (via /Users/victor/work/larix/.yarn/virtual/@yarnpkg-pnpify-virtual-9e4a182610/0/cache/@yarnpkg-pnpify-npm-2.0.0-rc.3-48ed462780.zip/node_modules/@yarnpkg/pnpify/lib/dynamicRequire.js)
at Object.makeError (/Users/victor/work/larix/.pnp.js:9151:26)
at resolveToUnqualified (/Users/victor/work/larix/.pnp.js:11549:43)
at resolveRequest (/Users/victor/work/larix/.pnp.js:11604:31)
at Object.resolveRequest.maybeLog [as resolveRequest] (/Users/victor/work/larix/.pnp.js:11643:32)
at Function.module_1.default._resolveFilename (/Users/victor/work/larix/.pnp.js:11074:37)
at Function.module_1.default._load (/Users/victor/work/larix/.pnp.js:10995:45)
at Module.require (internal/modules/cjs/loader.js:637:17)
at Object.require [as dynamicRequire] (internal/modules/cjs/helpers.js:22:18)
at Object.exports.generateEslintWrapper (/Users/victor/work/larix/.yarn/virtual/@yarnpkg-pnpify-virtual-9e4a182610/0/cache/@yarnpkg-pnpify-npm-2.0.0-rc.3-48ed462780.zip/node_modules/@yarnpkg/pnpify/lib/generateSdk.js:49:112)
```
**Proposed approach to fix the issue**
We can generate SDK only for the packages that are installed in the project and skip SDK generation for those that are not.
**Sherlock repro**
``` js repro
await packageJsonAndInstall({
"devDependencies": {
"@yarnpkg/pnpify": "^2.0.0-rc.3",
"typescript": "^3.6.3"
}
});
await expect(yarn(`pnpify`, `--sdk`)).rejects.not.toThrow('Command failed');
```04 / LABELS
Labels from the report text only; not yet run
conflictLabel rules and the text that matched
[
{
"category": "conflict",
"rule": "signature.incompatible_declared_requirements",
"source": "failure_signature",
"excerpt": "Error: A package is trying to access a peer dependency that should be provided by its direct ancestor but isn't"
}
]Issue-specific recipe and runtime smoke command require review against the complete issue and repository.
Legacy reproduction is generic install-only; match the actual issue failure before admission.