Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load config "xo/esnext" to extend from #404

Closed
coreyfarrell opened this issue Sep 26, 2019 · 16 comments
Closed

Failed to load config "xo/esnext" to extend from #404

coreyfarrell opened this issue Sep 26, 2019 · 16 comments

Comments

@coreyfarrell
Copy link
Contributor

I always keep xo installed globally so I can usually run lint without running npm install on the local repo. This does not work for me after updating my global install to 0.25.3:

$ npm i -g xo
$ rm -fr node_modules
$ xo
Error: Failed to load config "xo/esnext" to extend from.
Referenced from: BaseConfig
    at configMissingError (/home/cfarrell/.nvm/versions/node/v12.10.0/lib/node_modules/xo/node_modules/eslint/lib/cli-engine/config-array-factory.js:233:9)
    at ConfigArrayFactory._loadExtendedShareableConfig (/home/cfarrell/.nvm/versions/node/v12.10.0/lib/node_modules/xo/node_modules/eslint/lib/cli-engine/config-array-factory.js:712:23)
    at ConfigArrayFactory._loadExtends (/home/cfarrell/.nvm/versions/node/v12.10.0/lib/node_modules/xo/node_modules/eslint/lib/cli-engine/config-array-factory.js:617:25)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (/home/cfarrell/.nvm/versions/node/v12.10.0/lib/node_modules/xo/node_modules/eslint/lib/cli-engine/config-array-factory.js:547:25)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigData (/home/cfarrell/.nvm/versions/node/v12.10.0/lib/node_modules/xo/node_modules/eslint/lib/cli-engine/config-array-factory.js:491:20)
    at _normalizeObjectConfigData.next (<anonymous>)
    at createConfigArray (/home/cfarrell/.nvm/versions/node/v12.10.0/lib/node_modules/xo/node_modules/eslint/lib/cli-engine/config-array-factory.js:307:25)
    at ConfigArrayFactory.create (/home/cfarrell/.nvm/versions/node/v12.10.0/lib/node_modules/xo/node_modules/eslint/lib/cli-engine/config-array-factory.js:362:16)
    at createBaseConfigArray (/home/cfarrell/.nvm/versions/node/v12.10.0/lib/node_modules/xo/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:84:48)

This seems to be caused by eslint@6, see https://eslint.org/docs/user-guide/migrating-to-6.0.0#-plugins-and-shareable-configs-are-no-longer-affected-by-eslints-location

@coreyfarrell
Copy link
Contributor Author

Unrelated note while inspecting my global install I noticed some .DS_Store files leaked into the npm publish of xo and related modules.

@rizowski
Copy link

0.25.2 does not have this issue. So it was introduced in the last version

@coreyfarrell
Copy link
Contributor Author

@rizowski Thanks for the suggestion however I just ran npm i -g [email protected] and still have the issue. I verified the correct version was installed globally.

@rizowski
Copy link

rizowski commented Oct 1, 2019

Oh my mistake. I have a similar error but it is around loading the plugin unicorn from the BaseConfig. That error goes away when I go back a version. I also have XO installed locally, I wouldn't think that would matter too much.

@jmcbee
Copy link

jmcbee commented Oct 7, 2019

I'm experiencing this even when xo installed locally on a project. Is there a temporary fix?

@cayasso
Copy link

cayasso commented Oct 8, 2019

Same issue here :-(

@fisker
Copy link
Contributor

fisker commented Oct 10, 2019

maybe related

Can't load ava plugin in sindresorhus/eslint-plugin-unicorn#387

But only fails on CI https://travis-ci.org/sindresorhus/eslint-plugin-unicorn/jobs/595170571

@akramsaouri
Copy link

yeah rolling back to 0.25.2 fixes it for now.

@jscheffner
Copy link

I have the same issue, both with the latest version and with 0.25.2

@jscheffner
Copy link

Rolling back to 0.24.x fixed it for me

@rizowski
Copy link

Some testing around some of these base-config errors I've noticed that removing your node_modules and reinstalling after an upgrade can help fix this issue.

@officialpiyush
Copy link

Can reproduce, xo v0.28.0

Error: Failed to load config "xo/esnext" to extend from.
Referenced from: BaseConfig
    at configMissingError (C:\Projects\Classified\ems\node_modules\.pnpm\registry.npmjs.org\eslint\6.8.0\node_modules\eslint\lib\cli-engine\config-array-factory.js:265:9)
    at ConfigArrayFactory._loadExtendedShareableConfig (C:\Projects\Classified\ems\node_modules\.pnpm\registry.npmjs.org\eslint\6.8.0\node_modules\eslint\lib\cli-engine\config-array-factory.js:826:23)
    at ConfigArrayFactory._loadExtends (C:\Projects\Classified\ems\node_modules\.pnpm\registry.npmjs.org\eslint\6.8.0\node_modules\eslint\lib\cli-engine\config-array-factory.js:731:25)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (C:\Projects\Classified\ems\node_modules\.pnpm\registry.npmjs.org\eslint\6.8.0\node_modules\eslint\lib\cli-engine\config-array-factory.js:660:25)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigData (C:\Projects\Classified\ems\node_modules\.pnpm\registry.npmjs.org\eslint\6.8.0\node_modules\eslint\lib\cli-engine\config-array-factory.js:596:20)
    at _normalizeObjectConfigData.next (<anonymous>)
    at createConfigArray (C:\Projects\Classified\ems\node_modules\.pnpm\registry.npmjs.org\eslint\6.8.0\node_modules\eslint\lib\cli-engine\config-array-factory.js:340:25)
    at ConfigArrayFactory.create (C:\Projects\Classified\ems\node_modules\.pnpm\registry.npmjs.org\eslint\6.8.0\node_modules\eslint\lib\cli-engine\config-array-factory.js:395:16)
    at createBaseConfigArray (C:\Projects\Classified\ems\node_modules\.pnpm\registry.npmjs.org\eslint\6.8.0\node_modules\eslint\lib\cli-engine\cascading-config-array-factory.js:86:48)

PS: I use pnpm, and I tried removing node_modules and reinstalling, it is installed both locally and globally

@friederbluemle
Copy link

I ran into the same issue with a global xo installation.

@coreyfarrell was right on point with his initial assessment:

This seems to be caused by eslint@6

To add another quote from ESLint's migration guide:

If you use a global installation of ESLint (e.g. installed with npm install eslint --global) along with plugins, you should install those plugins locally in the projects where you run ESLint. [...]

I got it to work after locally installing the required configs/plugins:

npm i -D eslint-config-xo

There are likely other missing packages, e.g. eslint-plugin-import etc. - They all need to be available locally.

The reason why [email protected] still works is because it uses ESLint 5. [email protected] and later uses ESLint 6.

@isghe

This comment was marked as duplicate.

@fregante fregante changed the title [email protected] not working unless installed locally Failed to load config "xo/esnext" to extend from Aug 6, 2022
@fregante
Copy link
Member

fregante commented Aug 6, 2022

I occasionally have this bug when adding/removing dependencies. Usually deleting node_modules and the lock fixes it, but recently the error persisted until I updated all of the dependencies and tried again.

Related:

@fregante
Copy link
Member

I haven't seen this in a while. The problem in any case it's not in XO but in npm and eslint.

The solution is to do a fresh reinstall, without lockfile and node_modules.

It will eventually be resolved with the flat config:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests