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

Error: Failed to load plugin 'prettier' declared in 'BaseConfig' #642

Closed
younho9 opened this issue Dec 7, 2021 · 3 comments
Closed

Error: Failed to load plugin 'prettier' declared in 'BaseConfig' #642

younho9 opened this issue Dec 7, 2021 · 3 comments

Comments

@younho9
Copy link

younho9 commented Dec 7, 2021

When I run yarn xo command, encounter following error message.

TypeError [ERR_INVALID_ARG_VALUE]: Failed to load plugin 'prettier' declared in 'BaseConfig': The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received ''
Referenced from: BaseConfig
    at new NodeError (node:internal/errors:371:5)
    at createRequire (node:internal/modules/cjs/loader:1214:13)

My XO Configuration.

"xo": {
    "prettier": true,
    "extends": [
      "next/core-web-vitals"
    ]
  },

To reproduce,

  1. yarn create next-app
  2. remove default eslintrc.json
  3. add xo field to package.json and add above xo configuration.

Related with

#546
#483

@younho9 younho9 changed the title Failed to load plugin 'prettier' declared in 'BaseConfig' Error: Failed to load plugin 'prettier' declared in 'BaseConfig' Dec 7, 2021
@jonahsnider
Copy link
Contributor

Try following these instructions.

I'm able to reproduce the error when I extend next/core-web-vitals like you posted but using the config from Usage With Other Tools seems to work.

@younho9
Copy link
Author

younho9 commented Dec 18, 2021

Thanks. Using config of next plugin as you commented works.

module.exports = {
  extends: [
    //...
    'plugin:@next/next/recommended',
  ],
}

But, eslint-config-next is using several plugins internally, if I extend it directly from xo config, it seems to cause error.

I'm still wondering if there are any restrictions on extending other configs.

@fregante
Copy link
Member

fregante commented Aug 6, 2022

Duplicate of #546

@fregante fregante marked this as a duplicate of #546 Aug 6, 2022
@fregante fregante closed this as not planned Won't fix, can't repro, duplicate, stale Aug 6, 2022
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

3 participants