apollographql / apollographql/apollo-tooling
Yarn V2 compatibility
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 460
- PR merge metrics
- No merged PRs in 30d
Description
**Intended outcome:**
apollo commands should work normally when using Yarn V2 with Plug'n'Play
**Actual outcome:**
It fails with the following:
```
(node:61) Error Plugin: apollo: could not find package.json with { type: 'core',
root:
'/app/.yarn/cache/apollo-npm-2.25.0-39bd67c43e-2.zip/node_modules/apollo',
name: '@oclif/plugin-help' }
module: @oclif/config@1.14.0
task: loadPlugins
plugin: apollo
root: /app/.yarn/cache/apollo-npm-2.25.0-39bd67c43e-2.zip/node_modules/apollo
See more details with DEBUG=*
(node:61) Error Plugin: apollo: could not find package.json with { type: 'core',
root:
'/app/.yarn/cache/apollo-npm-2.25.0-39bd67c43e-2.zip/node_modules/apollo',
name: '@oclif/plugin-not-found' }
module: @oclif/config@1.14.0
task: loadPlugins
plugin: apollo
root: /app/.yarn/cache/apollo-npm-2.25.0-39bd67c43e-2.zip/node_modules/apollo
See more details with DEBUG=*
(node:61) Error Plugin: apollo: could not find package.json with { type: 'core',
root:
'/app/.yarn/cache/apollo-npm-2.25.0-39bd67c43e-2.zip/node_modules/apollo',
name: '@oclif/plugin-plugins' }
module: @oclif/config@1.14.0
task: loadPlugins
plugin: apollo
root: /app/.yarn/cache/apollo-npm-2.25.0-39bd67c43e-2.zip/node_modules/apollo
See more details with DEBUG=*
(node:61) Error Plugin: apollo: could not find package.json with { type: 'core',
root:
'/app/.yarn/cache/apollo-npm-2.25.0-39bd67c43e-2.zip/node_modules/apollo',
name: '@oclif/plugin-warn-if-update-available' }
module: @oclif/config@1.14.0
task: loadPlugins
plugin: apollo
root: /app/.yarn/cache/apollo-npm-2.25.0-39bd67c43e-2.zip/node_modules/apollo
See more details with DEBUG=*
Error: @oclif/parser tried to access @oclif/errors, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Required package: @oclif/errors (via "@oclif/errors")
Required by: @oclif/parser@npm:3.8.4 (via /app/.yarn/cache/@oclif-parser-npm-3.8.4-dd47359399-2.zip/node_modules/@oclif/parser/lib/)
Require stack:
- /app/.yarn/cache/@oclif-parser-npm-3.8.4-dd47359399-2.zip/node_modules/@oclif/parser/lib/validate.js
- /app/.yarn/cache/@oclif-parser-npm-3.8.4-dd47359399-2.zip/node_modules/@oclif/parser/lib/index.js
- /app/.yarn/$$virtual/@oclif-command-virtual-818296db1a/0/cache/@oclif-command-npm-1.5.19-b10e786c92-2.zip/node_modules/@oclif/command/lib/flags.js
- /app/.yarn/$$virtual/@oclif-command-virtual-818296db1a/0/cache/@oclif-command-npm-1.5.19-b10e786c92-2.zip/node_modules/@oclif/command/lib/index.js
- /app/.yarn/cache/apollo-npm-2.25.0-39bd67c43e-2.zip/node_modules/apollo/bin/run
at Object.makeError (/app/.pnp.js:34509:34)
at resolveToUnqualified (/app/.pnp.js:41869:37)
at resolveRequest (/app/.pnp.js:41959:27)
at Object.resolveRequest.maybeLog [as resolveRequest] (/app/.pnp.js:42027:26)
at Function.module_1.Module._resolveFilename (/app/.pnp.js:41222:34)
at Function.module_1.Module._load (/app/.pnp.js:41107:40)
at Object. (/app/.yarn/cache/@oclif-parser-npm-3.8.4-dd47359399-2.zip/node_modules/@oclif/parser/lib/validate.js:3:18)
```
**How to reproduce the issue:**
Bootstrap any Yarn V2 project, add the apollo dependency and run any apollo command.
**Versions**
Tested with 2.21.2 and latest (2.25.0)
Contributor guide
Research direction
Start by bootstrapping a Yarn V2 project with Plug'n'Play, adding Apollo CLI 2.25.0, and running an Apollo command to reproduce the reported plugin and dependency-resolution errors. Trace the failing CLI dependency loading from the reported stack and verify that Apollo commands run normally in the Yarn V2 project without those errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100