Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Catch JSON errors issue #120

Closed
alexbeletsky opened this issue Jul 10, 2015 · 14 comments
Closed

Catch JSON errors issue #120

alexbeletsky opened this issue Jul 10, 2015 · 14 comments
Labels

Comments

@alexbeletsky
Copy link

There is such commit for handling parsing errors, it makes total sense, but after upgrade it put my Atom in a mess.

While I open any .js file, I see error notification "Invalid Result recieved from JSHint".

The reason is JSON.parse() is not able to handle empty strings and throws an exception. I'm not sure, but maybe jshint previosly returned {} or [], but not it's just empty "".

There should be a check for empty string and if so, skip the rest of processing. If you are fine with that I can submit a PR.

PS. there is a typo in recieved => received.. I'm always doing that mistake, as well :)

@steelbrain
Copy link
Contributor

Yep, this is a known bug on OSX that child_process.spawn of node returns empty when you run it from applications, run it from CLI to make it work

@alexbeletsky
Copy link
Author

sorry, what do you mean "run it from CLI to make it work"?

@steelbrain
Copy link
Contributor

atom /path/to/folder

@alexbeletsky
Copy link
Author

that helps, indeed.. but doesn't sound like a solution. Could be the reason that child_process.spawn requires a cwd or anything else is missing?

@steelbrain
Copy link
Contributor

could you hard-code a cwd and report if it works? :)

@wmccracken
Copy link

I'm seeing this same error. It goes away if I run from the command line but then is seems the jsxhint is broken.

@alexbeletsky
Copy link
Author

@steelbrain tried and it works fine with cmd being set, is there any way we can get cmd from atom object, perhaps (I'm not very familiar with internals)

@alexbeletsky
Copy link
Author

@steelbrain sorry, was to fast. nope, cmd set seems not helping.

@stdavis
Copy link

stdavis commented Jul 10, 2015

I'm getting the same error message as well on OSX. I agree with @alexbeletsky that opening from the command line isn't a great solution. I'd be happy to help test proposed solutions.

@steelbrain
Copy link
Contributor

can you guys post the contents of process.env.PATH from dev tools?

@stdavis
Copy link

stdavis commented Jul 10, 2015

image

@steelbrain
Copy link
Contributor

now what's the result of echo $PATH in your terminal?

@stdavis
Copy link

stdavis commented Jul 10, 2015

image

@steelbrain
Copy link
Contributor

Now that's what the problem is :D
Moved to steelbrain/linter#726

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants