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

Debugging "Failed to load config" #235

Closed
ehaynes99 opened this issue Feb 7, 2023 · 6 comments
Closed

Debugging "Failed to load config" #235

ehaynes99 opened this issue Feb 7, 2023 · 6 comments

Comments

@ehaynes99
Copy link

I've had several instances lately where eslint works fine, but eslint_d reports Failed to load config "whatever" to extend from. These are shared configs that are loaded as npm modules. I hate writing a bad bug report, and I don't really have enough info to report an issue about the specifics, so... I'm reporting an issue about not being able to get enough info about the specifics. :-)

Is there anywhere to get additional details about this kind of path resolution failure?

$ ./node_modules/.bin/eslint src

/home/ehaynes99/tmp/sandbox/src/index.ts
  1:17  error  Delete `·`  prettier/prettier

✖ 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.
$ eslint_d src
Error: Failed to load config "erich" to extend from.
Referenced from: /home/erich/tmp/sandbox/.eslintrc.js

The references config is e.g.:

$ cat .eslintrc.js 
module.exports = {
  extends: ['erich'],
  parserOptions: {
    project: 'tsconfig.json',
    tsconfigRootDir: __dirname,
    sourceType: 'module',
  },
}

The referenced config is present in node_modules/eslint-config-erich (https://www.npmjs.com/package/eslint-config-erich). This has happened with others, though. E.g. one of my projects at work references https://www.npmjs.com/package/eslint-plugin-etc as a plugin, and the same issue occurs.

@mantoni
Copy link
Owner

mantoni commented Feb 7, 2023

Thanks for reporting. I made #87 quite some time ago since I had trouble fixing issues myself. It would be great to get some help implementing something like this.

@dro-sh
Copy link

dro-sh commented Feb 23, 2023

Have the same issue on eslint ^8.*.*

P.S.
I delete ~/.eslint-d and restart eslint_d. It helps me to fix issue

@ehaynes99
Copy link
Author

Huh, I don't have a file of that name anywhere on my filesystem. I haven't encountered it again since I filed this, though. I still think more informative output would be helpful (though I guess it depends whether eslint actually emits anything more helpful :-) ). I'll try to come up with a PR for outputting more information when I get a chance, but I'm pretty swamped right now

@guoliang
Copy link

Have the same issue on eslint ^8.*.*

P.S. I delete ~/.eslint-d and restart eslint_d. It helps me to fix issue

this solved it for me too. although it would be interesting to know why it fixed the issue.

@axynos
Copy link

axynos commented Apr 9, 2023

Had a similar issue with a Next.js 13 project where it would fail to load the config from eslint-config-next. Regular eslint worked fine, but for eslint_d running eslint_d stop and then reopening the project worked.

@mantoni mantoni mentioned this issue Jul 28, 2024
@mantoni
Copy link
Owner

mantoni commented Jul 28, 2024

This is probably obsolete with the new major v14.0.0 (see #294). Should you're still having the issue, please write here and I'm happy to re-open.

@mantoni mantoni closed this as completed Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants