Yarn 2: `Error: Failed to load config "xo/esnext" to extend from.`
See original GitHub issueI am upgrading to Yarn 2 and I am now getting the following error
Error: Failed to load config "xo/esnext" to extend from.
Referenced from: BaseConfig
at configMissingError (/project/.yarn/cache/eslint-npm-6.8.0-d27045f313-1.zip/node_modules/eslint/lib/cli-engine/config-array-factory.js:265:9)
at ConfigArrayFactory._loadExtendedShareableConfig (/project/.yarn/cache/eslint-npm-6.8.0-d27045f313-1.zip/node_modules/eslint/lib/cli-engine/config-array
-factory.js:826:23)
at ConfigArrayFactory._loadExtends (/project/.yarn/cache/eslint-npm-6.8.0-d27045f313-1.zip/node_modules/eslint/lib/cli-engine/config-array-factory.js:731:
25)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/project/.yarn/cache/eslint-npm-6.8.0-d27045f313-1.zip/node_modules/eslint/lib/cli-engine/config-arr
ay-factory.js:660:25)
at _normalizeObjectConfigDataBody.next (<anonymous>)
at ConfigArrayFactory._normalizeObjectConfigData (/project/.yarn/cache/eslint-npm-6.8.0-d27045f313-1.zip/node_modules/eslint/lib/cli-engine/config-array-f
actory.js:596:20)
at _normalizeObjectConfigData.next (<anonymous>)
at createConfigArray (/project/.yarn/cache/eslint-npm-6.8.0-d27045f313-1.zip/node_modules/eslint/lib/cli-engine/config-array-factory.js:340:25)
at ConfigArrayFactory.create (/project/.yarn/cache/eslint-npm-6.8.0-d27045f313-1.zip/node_modules/eslint/lib/cli-engine/config-array-factory.js:395:16)
at createBaseConfigArray (/project/.yarn/cache/eslint-npm-6.8.0-d27045f313-1.zip/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:86:4
8)
I am only extending xo-typescript
in my XO config and this error only started occurring after using Yarn 2.
I believe the error is due to Yarn 2’s “strict package boundaries”.
Packages aren’t allowed to require other packages unless they actually list them in their dependencies. This is in line with the changes we made back when we introduced Plug’n’Play more than a year ago, and we’re happy to say that the work we’ve been doing with the top maintainers of the ecosystem have been fruitful. Nowadays, very few packages still have compatibility issues with this rule. source Whatever is requiring
xo/esnext
doesn’t have it listed in their dependencies and is failing.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Error: Failed to load config "next" to extend from - Stack Overflow
Resolved, after installing this package, the code will run without error: npm i --save-dev eslint-config-next.
Read more >eslint-config-airbnb-base | Yarn - Package Manager
This package provides Airbnb's base JS .eslintrc (without React plugins) as an extensible shared config. Usage.
Read more >Configure and use Yarn with CodeArtifact - AWS Documentation
Yarn 1.X reads and uses information from your npm configuration file (.npmrc), while Yarn 2.X does not. The configuration for Yarn 2.
Read more >eslint/eslint - Gitter
Error : Failed to load config "local-rules/recommended" to extend from. I created the eslint-plugin-local-rules plugin in a sibling directory to the project ...
Read more >failed to load config from vite.config.ts - Laracasts
Hi, I am having trouble in using vite and getting below error while running yarn build command. I could not move forward even...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
A workaround for Yarn 2 is to add all the relevant ESLint config packages and plugins as direct devDependencies of your project, e.g.
Probably relevant: yarnpkg/berry#8, eslint/eslint#3458.
weirdly, i only have this issue inside of JetBrains IDEs. (I haven’t tested everywhere.) I’ve tried various ways of installing and picking which bin to use (local vs global, different versions, etc). And consistently, it works in the terminal but not in my IDE.
So I’m guessing there’s something dependent on shell or env var shenanigans. (At least, if also using
fnm
or other things like that)