Skip to content

Cannot read property 'filter' of undefined #100

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

Closed
stefan1968 opened this issue Oct 3, 2017 · 7 comments
Closed

Cannot read property 'filter' of undefined #100

stefan1968 opened this issue Oct 3, 2017 · 7 comments

Comments

@stefan1968
Copy link

Using versions: - "eslint-plugin-flowtype": "2.37.0",
"eslint-plugin-flowtype-errors": "3.3.2",

Getting the following errors, when I run lint:-

yarn lint v0.27.5
$ eslint ./app//.js
Cannot read property 'filter' of undefined
TypeError: Cannot read property 'filter' of undefined
at collect (/Users/stefanwalker/Projects/Influence/Frontend2/node_modules/eslint-plugin-flowtype-errors/dist/collect.js:178:3)
at Program (/Users/stefanwalker/Projects/Influence/Frontend2/node_modules/eslint-plugin-flowtype-errors/dist/index.js:94:48)

@jdmota
Copy link
Collaborator

jdmota commented Oct 6, 2017

Can you provide a minimal test case with the contents of that file?

jdmota added a commit to jdmota/eslint-plugin-flowtype-errors that referenced this issue Oct 6, 2017
@jdmota jdmota mentioned this issue Oct 6, 2017
@leyyinad
Copy link

leyyinad commented Oct 9, 2017

I got the same in . I didn't have the time yet to strip it down to a minimal test case, but maybe this is of help: The error happens in (list) collect.js, line 178.

parsedJSONArray is:

{ flowVersion: '0.56.0',
  exit:
   { code: 110,
     reason: 'Unknown_error',
     msg: 'Unhandled exception: End_of_file' } }

so parsedJSONArray.errors and hence parsedJSONArray.errors.filter is not defined.

Versions are:

Flow finishes with no errors at all. What might cause this?

@jdmota
Copy link
Collaborator

jdmota commented Oct 9, 2017

Thanks! I will update my PR so that we show an error instead of ignoring.

amilajack pushed a commit that referenced this issue Oct 9, 2017
* Fix #46 and #100

* Show error if flow returned an error
@amilajack
Copy link
Owner

Was this resolved?

@vitbokisch
Copy link

In my case eslint seemed to be working correctly, but using this plugin broke prettier formatting and got the same error message. Not sure if this helps with debugging the error...

@jdmota
Copy link
Collaborator

jdmota commented Jun 4, 2018

We no longer use filter in the collect.js file. Can this be closed?

@nwoltman
Copy link
Collaborator

nwoltman commented Sep 2, 2018

@jdmota I am very certain that this can be closed. I believe #101 did fix it and then .filter() was removed in #119, so this can't possibly still be a problem.

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

6 participants