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

TypeError: undefined is not a function #28

Closed
trevordmiller opened this issue Sep 3, 2015 · 7 comments
Closed

TypeError: undefined is not a function #28

trevordmiller opened this issue Sep 3, 2015 · 7 comments

Comments

@trevordmiller
Copy link

Your package is great! I'm just running into one issue: when I run my npm run dev script, which uses npm-run-all I get a TypeError: undefined is not a function error, which is preventing my lint:watch script from running. I have done some debugging, and everything works as expected running npm run lint:watch by itself, or npm run dev without the lint:watch command...but I don't know how to debug it. Is this a known issue with eslint-watch in the way that it handles npm script arguments or something?

Related issue

I don't know if this is an issue with eslint-watch or npm-run-all, so I have posted the issue in both places. I do know that all of my other packages work as expected so something seems to be wrong with either eslint-watch or npm-run-all.

mysticatea/npm-run-all#9

Steps to reproduce:

screen shot 2015-09-03 at 12 56 44 pm


p.s. I don't understand why eslint-watch hasn't been merged into the core eslint package?

@rizowski
Copy link
Owner

rizowski commented Sep 3, 2015

@trevordmiller Thanks for posting this, I will take a look at it a little later tonight.
As for your P.S. take a look here: eslint/eslint#2513

@rizowski
Copy link
Owner

rizowski commented Sep 6, 2015

@trevordmiller Just a bit of digging I found the culprit. As for why it is throwing, it would seem that having npm-run-all run eslint-watch -w messes with process.stdin in some way. Maybe because the process is nested within npm-run-all, i'm not a 100% sure. But to resolve this I need a little more information, what version of node are you using?

The only thing this will affect is being able to hit enter to rerun the lint. The watch should still work.

@rizowski
Copy link
Owner

rizowski commented Sep 6, 2015

@mysticatea This may still be a bug on your side since it seems when npm-run-all is running esw -w it disables the ability to hit enter and rerun the lint. Look to the above comment for a little context. I'll keep looking into this and see if there is anything I can do. Let me know if you need anything for your side.

@trevordmiller
Copy link
Author

@rizowski Thanks for looking into it. Yeah, I'm not sure. Basically, I just want to be able to watch my linting (eslint), tests (mocha), and build (babel) at the same time using npm scripts; the -w watch command of the mocha and babel CLIs both work with the packages I have tried for running multiple commands at once (npm-run-all and parallel-shell) but I'm not sure why eslint doesn't. I'll keep tinkering. Thanks again!

@mysticatea
Copy link

@rizowski Thank you for investing. I have gotten the cause, thanks to your hint. When npm-run-all spawns child processes, it's setting ignore to stdin. I changed it to inherit, then this error disappeared.

@rizowski @trevordmiller I will release fixed version today.
I apologize for wasting your time.

@trevordmiller
Copy link
Author

@mysticatea You didn't waste my time - that is great news! Thank you so much :) Thank you @rizowski for your help as well. You both are awesome 👍

@rizowski
Copy link
Owner

rizowski commented Sep 7, 2015

Awesome. Glad I could help. 😃

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

3 participants