question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Yarn 2: `Error: Failed to load config "xo/esnext" to extend from.`

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
anderskcommented, Nov 8, 2020

A workaround for Yarn 2 is to add all the relevant ESLint config packages and plugins as direct devDependencies of your project, e.g.

yarn add -D eslint eslint-config-xo eslint-plugin-{ava,eslint-comments,import,no-use-extend-native,node,promise,unicorn}

Probably relevant: yarnpkg/berry#8, eslint/eslint#3458.

3reactions
floer32commented, Dec 15, 2020

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)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found