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 flowtype: Cannot find module './configs/recommended.json' #110

Closed
borisyankov opened this issue Sep 12, 2016 · 12 comments

Comments

@borisyankov
Copy link

Just updated to latest 2.17.0 version and am getting this error:

Error: Failed to load plugin flowtype: Cannot find module './configs/recommended.json'
@danharper
Copy link
Collaborator

😨 looking into it now

@darthtrevino
Copy link

Should this config file exist under the dist/ folder? If so, I don't see it exist at all in any version of this lib.

@danharper
Copy link
Collaborator

Yep, that's fixed.

Been trying to ship a release for 15 minutes, didn't quite realise Travis was failing because we depend on our own plugin, which currently has an invalid release out.

So Travis goes to install deps, and our own lint fails because the eslint-plugin-flowtype plugin is invalid...

(that wasn't fun lol)

v2.17.1 is building now.

@danharper
Copy link
Collaborator

v2.17.1 is now out - thanks everyone for the help! :) .. and sorry for bodging that last release!

@borisyankov
Copy link
Author

Awesome response time ;)
Thanks.

@cyberwombat
Copy link

I am still getting this error on 2.20.0. I use standard --fix v8.4.0 and have this in my package.json

"standard": {
    "plugins": [
      "flowtype"
    ]
  },

@danharper
Copy link
Collaborator

@cyberwombat What's the exact error?

@cyberwombat
Copy link

cyberwombat commented Oct 14, 2016

Error: Failed to load plugin flowtype: Cannot find module 'eslint-plugin-flowtype'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.load (/usr/local/lib/node_modules/standard/node_modules/eslint/lib/config/plugins.js:129:26)
    at Array.forEach (native)
    at Object.loadAll (/usr/local/lib/node_modules/standard/node_modules/eslint/lib/config/plugins.js:151:21)
    at Config.getConfig (/usr/local/lib/node_modules/standard/node_modules/eslint/lib/config.js:305:17)
    at hashOfConfigFor (/usr/local/lib/node_modules/standard/node_modules/eslint/lib/cli-engine.js:594:41)
    at executeOnFile (/usr/local/lib/node_modules/standard/node_modules/eslint/lib/cli-engine.js:643:32)

I am running this in my repo:

standard --fix src/myfile.js

Standard and eslint are at latest version.

My node_modules/eslint-plugin-flowtype module exists, is correct version (also tried all the way down to 2.17), has a dist folder which appears to contain working transpiled code.

@danharper
Copy link
Collaborator

Hm, it seems to be a different issue (can't find the module as opposed to the default config).

I don't use Standard, but if you could create a repo with a minimal reproduction showing this problem, I could look into it?

Could it be a global vs local modules thing? I don't run anything globally, but it looks like you're running standard globally. Does eslint-plugin-flowtype have to be installed globally too? idk.

@cyberwombat
Copy link

Standardjs does say to load globally - just read that on their site (or install standard locally). When I do it then it appears that it doesn't use the plugin as my code:

function asyncAppViewResolver(viewName: string) {

Yields: Parsing error: Unexpected token :

You are probably correct that it's a StandardJS config issue. I will continue looking in that direction for a bit then try to reproduce.

@danharper
Copy link
Collaborator

From that error, it looks like you also need to enable Babel ESLint so that
Babel can parse the files instead.

On Fri, 14 Oct 2016, 22:26 Yashua, notifications@github.com wrote:

Standardjs does say to load globally - just read that on their site (or
install standard locally). When I do it then it appears that it doesn't use
the plugin as my code:

function asyncAppViewResolver(viewName: string) {

Yields: Parsing error: Unexpected token :

You are probably correct that it's a StandardJS config issue. I will
continue looking in that direction for a bit then try to reproduce.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#110 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAfLFGGgI0TjXV-JTIkzS2aebm_QtuX_ks5qz_N6gaJpZM4J6-6o
.

@cyberwombat
Copy link

Yup! Just read this. Looks like the docs on StandardJS about Flow need updating. Thanks!

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

4 participants