Failed to load parser '@typescript-eslint/parser' declared in 'BaseConfig » /Users/vvni/OffSource/yunmeng-mall-webapp/.yarn/virtual/eslint-config-react-app-virtual-fa3c1f4ab2/0/cache/eslint-config-react-app-npm-5.0.2-b7b16e6537-1.zip/node_modules/eslint-config-react-app/index.js#overrides[0]': A package is trying to access a peer dependency that should be provided by its direct ancestor but isn't
Required package: typescript (via "typescript")
Required by: @typescript-eslint/typescript-estree@virtual:44860fa3e51ac3b5ff8d790a8c36fb7d6ab296a0c395a0e1c3db2cc1dcc9433416e53144c77819fccdd3d8ce8abba0ee2d1c2f0c6a00888059b912e0edde4e26#npm:2.7.0 (via /Users/vvni/OffSource/yunmeng-mall-webapp/.yarn/virtual/@typescript-eslint-typescript-estree-virtual-dd21f9bbc0/0/cache/@typescript-eslint-typescript-estree-npm-2.7.0-1b6868dd7c-1.zip/node_modules/@typescript-eslint/typescript-estree/dist/parser.js)

yarn install?My best guess is that both of those packages should list typescript as an (optional) peer dependency, since typescript-estree requires to access it:
https://cdn.jsdelivr.net/npm/@typescript-eslint/parser/package.json
https://cdn.jsdelivr.net/npm/eslint-config-react-app/package.json
>
@arcanis
- Case: https://github.com/vvni/yunmeng-mall-webapp.git
- No warning when installing
在 2019年11月18日 +0800 AM11:05,Maël Nison notifications@github.com,写道:
>
- No reproduction case makes it hard to be sure
- Do you have a peer dependency warning when running yarn install?
My best guess is that both of those packages should list typescript as an (optional) peer dependency, since typescript-estree requires to access it:
https://cdn.jsdelivr.net/npm/@typescript-eslint/parser/package.json
https://cdn.jsdelivr.net/npm/eslint-config-react-app/package.json
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
As this is closed, is there any solution for this?
Error: Failed to load parser '@typescript-eslint/parser' declared in '.eslintrc.js » eslint-config-airbnb-typescript/base » ~\projects\gh\renovate\.yarn\$$virtual\eslint-config-airbnb-typescript-virtual-b3c2d2fd87\0\cache\eslint-config-airbnb-typescript-npm-6.3.1-4f1c427688-1.zip\node_modules\eslint-config-airbnb-typescript\lib\shared.js': A package is trying to access a peer dependency that should be provided by its direct ancestor but isn't
Required package: typescript (via "typescript")
Required by: @typescript-eslint/typescript-estree@virtual:fc78876e07396419642eda8c10ed454eda15b9e947b012c4f00d3f606e7cb49afb907a2ed72c020045a13197ba1eae0805cfae2b9a4b2752b3c0e15634a954c5#npm:2.14.0 (via /C:/Users/kriese/projects/gh/renovate/.yarn/$$virtual/@typescript-eslint-typescript-estree-virtual-0393465a19/0/cache/@typescript-eslint-typescript-estree-npm-2.14.0-0548142d0a-1.zip/node_modules/@typescript-eslint/typescript-estree/dist/)
Require stack:
- ~\projects\gh\renovate\.yarn\$$virtual\@typescript-eslint-typescript-estree-virtual-0393465a19\0\cache\@typescript-eslint-typescript-estree-npm-2.14.0-0548142d0a-1.zip\node_modules\@typescript-eslint\typescript-estree\dist\parser.js
- ~\projects\gh\renovate\.yarn\$$virtual\@typescript-eslint-parser-virtual-fc78876e07\0\cache\@typescript-eslint-parser-npm-2.14.0-766de38fdd-1.zip\node_modules\@typescript-eslint\parser\dist\parser.js
- ~\projects\gh\renovate\.yarn\cache\eslint-npm-6.8.0-d27045f313-1.zip\node_modules\eslint\lib\cli-engine\config-array-factory.js
- ~\projects\gh\renovate\.yarn\cache\eslint-npm-6.8.0-d27045f313-1.zip\node_modules\eslint\lib\cli-engine\cascading-config-array-factory.js
- ~\projects\gh\renovate\.yarn\cache\eslint-npm-6.8.0-d27045f313-1.zip\node_modules\eslint\lib\cli-engine\cli-engine.js
- ~\projects\gh\renovate\.yarn\cache\eslint-npm-6.8.0-d27045f313-1.zip\node_modules\eslint\lib\cli-engine\index.js
- ~\projects\gh\renovate\.yarn\cache\eslint-npm-6.8.0-d27045f313-1.zip\node_modules\eslint\lib\cli.js
- ~\projects\gh\renovate\.yarn\cache\eslint-npm-6.8.0-d27045f313-1.zip\node_modules\eslint\bin\eslint.js
at Object.makeError (~\projects\gh\renovate\.pnp.js:20146:24)
at resolveToUnqualified (~\projects\gh\renovate\.pnp.js:24561:35)
at resolveRequest (~\projects\gh\renovate\.pnp.js:24654:27)
at Object.resolveRequest (~\projects\gh\renovate\.pnp.js:24722:26)
at Function.module_1.Module._resolveFilename (~\projects\gh\renovate\.pnp.js:23960:34)
at Function.module_1.Module._load (~\projects\gh\renovate\.pnp.js:23835:40)
at Module.require (internal/modules/cjs/loader.js:852:19)
at require (~\projects\gh\renovate\.yarn\cache\v8-compile-cache-npm-2.1.0-86ea69cdd0-1.zip\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
at Object.<anonymous> (~\projects\gh\renovate\.yarn\$$virtual\@typescript-eslint-typescript-estree-virtual-0393465a19\0\cache\@typescript-eslint-typescript-estree-npm-2.14.0-0548142d0a-1.zip\node_modules\@typescript-eslint\typescript-estree\dist\parser.js:17:25)
at Module._compile (~\projects\gh\renovate\.yarn\cache\v8-compile-cache-npm-2.1.0-86ea69cdd0-1.zip\node_modules\v8-compile-cache\v8-compile-cache.js:194:30)
@ViceIce in your case this is because eslint-config-airbnb-typescript doesn't list typescript in its peer dependencies, so its dependencies (including @typescript-eslint/parser) don't have permission to access it.
TypeScript being missing isn't displayed here because @typescript-eslint/parser only list it as an optional peer dependency, but it's the same error as the others printed here:

if i add the following to my .yarnrc.yml eslint crashes with oom
packageExtensions:
"eslint-config-airbnb-typescript@*":
peerDependencies:
eslint: "*"
eslint-plugin-import: "*"
typescript: "*"
yarn: 2.0.0-rc.21
node: v12.14.0
<--- Last few GCs --->
[3916:000002331CB60C80] 415470 ms: Mark-sweep 2039.4 (2050.9) -> 2038.5 (2050.9) MB, 2585.7 / 0.0 ms (average mu = 0.108, current mu = 0.018) allocation failure scavenge might not succeed[3916:000002331CB60C80] 418878 ms: Mark-sweep 2039.5 (2050.9) -> 2038.7 (2050.9) MB, 3383.9 / 0.1 ms (average mu = 0.061, current mu = 0.007) allocation failure scavenge might not succeed
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 00007FF6FB0F404D]
Security context: 0x00666f6008a1 <JSObject>
1: split [000000666F60D031](this=0x0030fb45e2f1 <String[66]: ~/projects/gh/renovate/test/manager/mix/extract.spec.ts>,0x02fadfd93699 <String[#1]: />)
2: pathComponents(aka pathComponents) [000000810570D081] [~\projects\gh\renovate\.yarn\cache\typescript-patch-d665bedbda-1.zip\node_modules\typescript\lib\typescript.js:~5972]...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 00007FF6FA52124F napi_wrap+124431
2: 00007FF6FA4C2A06 v8::base::CPU::has_sse+34502
3: 00007FF6FA4C36C6 v8::base::CPU::has_sse+37766
4: 00007FF6FACC82DE v8::Isolate::ReportExternalAllocationLimitReached+94
5: 00007FF6FACB0321 v8::SharedArrayBuffer::Externalize+833
6: 00007FF6FAB7DBEC v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1436
7: 00007FF6FAB88F90 v8::internal::Heap::ProtectUnprotectedMemoryChunks+1312
8: 00007FF6FAB85AC4 v8::internal::Heap::PageFlagsAreConsistent+3204
9: 00007FF6FAB7B353 v8::internal::Heap::CollectGarbage+1283
10: 00007FF6FAB79B24 v8::internal::Heap::AddRetainedMap+2356
11: 00007FF6FABA19B3 v8::internal::Factory::NewRawOneByteString+83
12: 00007FF6FABA11BB v8::internal::Factory::NewProperSubString+891
13: 00007FF6FA8E33A1 v8::internal::DeclarationScope::was_lazily_parsed+32225
14: 00007FF6FB0F404D v8::internal::SetupIsolateDelegate::SetupHeap+567949
15: 00007FF6FB0E17AA v8::internal::SetupIsolateDelegate::SetupHeap+492010
16: 0000038CEB9AE814
I get the same error message but with much less information about what is actually missing:
Failed to compile
./.yarn/$$virtual/apollo-utilities-virtual-7a551de862/0/cache/apollo-utilities-npm-1.3.3-8e73ac22c0-1.zip/node_modules/apollo-utilities/lib/bundle.esm.js
Module not found: A package is trying to access a peer dependency that should be provided by its direct ancestor but isn't
This error occurred during the build time and cannot be dismissed.
So, I have no idea how to work around this.
This is my project:
https://github.com/Mellbourn/saved-counter/tree/yarn2
@arcanis Doing yarn start in the subfolder packages/client should reproduce the problem.
Same. @Mellbourn Did you ever find a solution to this?
Fwiw, my issue is occurring with styled-components.
@JosNun nope. Gave up on berry for now
@JosNun I've had similar issues with many packages (I have circa 40 entries in .yarnrc.yaml file). I got stuck on apollo-client just as @Mellbourn and manage to solve it by unplugging desired package (apollo-utilities in my case) and manually move peerDependency (graphql in my case) to the dependencies and run yarn.
Please be aware that this might cause some unexpected issues and this change will be rolled back with package update. In the end, I'm able to run apollo-client with yarn@berry but this is now even proper workaround, just some hot fix, that should be removed ASAP.
I know this might be silly but... Have you @vvni and @viceice explicitly defined the typescript package, let's say, in your package.json devDependencies part?
I stumbled upon the same issue and I just figured out I totally forgot to do a yarn add -D typescript. That fixed my issue.
@darioblanco i have typescript listed in my dependencies but still getting "Failed to load parser" error 🤷♂️
Should works with
# .yarnrc.yml
pnpMode: "loose"
pnpFallbackMode: "all"
or
# .yarnrc.yml
nodeLinker: "node-modules"