AtomLinter / linter-julia

This linter plugin provides an interface to Lint.jl.
https://atom.io/packages/linter-julia
MIT License
17 stars 3 forks source link

Uncaught SyntaxError: Unexpected end of JSON input #43

Closed volkan-a closed 5 years ago

volkan-a commented 7 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.16.0 x64 Electron: 1.3.13 OS: Mac OS X 10.12.4 Thrown From: linter-julia package 0.7.2

Stack Trace

Uncaught SyntaxError: Unexpected end of JSON input

At file:///Applications/Atom.app/Contents/Resources/app.asar/static/index.html:1

SyntaxError: Unexpected end of JSON input
    at Object.parse (native)
    at /packages/linter-julia/lib/linter-julia.coffee:93:26)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:493:12)

Commands

     -0:26.1.0 julia-client:run-and-move (input.hidden-input)
     -0:20.7.0 editor:newline (input.hidden-input)
  3x -0:16.1.0 core:backspace (input.hidden-input)
     -0:14.2.0 julia-client:run-and-move (input.hidden-input)
     -0:12.1.0 inline:clear-current (input.hidden-input)
     -0:12.1.0 editor:consolidate-selections (input.hidden-input)
     -0:12.1.0 core:cancel (input.hidden-input)
     -0:10.9.0 inline:clear-current (input.hidden-input)
     -0:10.9.0 editor:consolidate-selections (input.hidden-input)
     -0:10.9.0 core:cancel (input.hidden-input)
     -0:10.2.0 inline:clear-current (input.hidden-input)
     -0:10.2.0 editor:consolidate-selections (input.hidden-input)
  2x -0:10.2.0 core:cancel (input.hidden-input)
  2x -0:05.7.0 core:move-right (input.hidden-input)
  2x -0:05.1.0 core:backspace (input.hidden-input)
     -0:03.6.0 autocomplete-plus:cancel (input.hidden-input)

Non-Core Packages

atom-dark-fusion-syntax 2.2.0 
autocomplete-python 1.8.63 
busy-signal 1.4.1 
git-plus 7.8.0 
Hydrogen 1.12.1 
ink 0.6.5 
intentions 1.1.2 
julia-client 0.5.12 
language-julia 0.11.0 
latex-completions 0.3.2 
linter 2.1.4 
linter-flake8 2.2.1 
linter-julia 0.7.2 
linter-ui-default 1.2.4 
nucleus-dark-ui 0.12.1 
python-debugger 0.2.0 
python-indent 1.0.2 
python-tools 0.6.9 
tool-bar 1.1.0 
uber-juno 0.1.1 
TeroFrondelius commented 7 years ago

See #38. Have you installed Lint.jl?

julia> Pkg.add("Lint")
volkan-a commented 7 years ago

Yes, but occasionally I get that error message.

aterenin commented 7 years ago

+1

Same issue here, occurs at random times. Lint.jl is installed and I've run Pkg.checkout("Lint") and using Lint at least once.

TeroFrondelius commented 7 years ago

I recommend testing the master versions. It's totally rewritten and only the testing is pending to release it.

gdkrmr commented 7 years ago

maybe this has something to do with this: https://github.com/gdkrmr/flycheck-julia/issues/1

in this case this might be the json returned by Lint.jl, but I am not sure yet.

dpsanders commented 7 years ago

How can we install the master version?

gdkrmr commented 7 years ago

Pkg.checkout("Lint") will install the latest master

dpsanders commented 7 years ago

I assumed that the reference was to the master version of the atom linter-julia package, rather than to Lint.jl. Am I wrong?

TeroFrondelius commented 7 years ago

Sorry for the late answer I have been travelling. @dpsanders is correct I meant linter-julia master version. Installing it should be as easy as copy-pasting the link to the github repo to the Atom install package search window.

aterenin commented 7 years ago

Just updated my Atom package version and will let you know if the error persists. As an FYI to anyone else who updates, be aware that the latest Git version of linter-julia does not correctly inherit the Julia executable path from Juno if it is something other than julia. You need to set it manually in the options.

kingwyf87 commented 7 years ago

Tried to use linter-julia in Atom on MacOS. Initially, got the errors similarly as in #43 and #38. Followed previous discussions: uninstalled "linter-ui-default" and installed the latest master "Lint.jl" but still get the below errors:

[Linter-Julia] Server returned non-JSON response:
/Users/yifei-macpro/.atom/packages/linter-julia/lib/index.js:107

[Linter] Error running Julia Error: Error parsing server response. See console for more info at Socket. (/Users/yifei-macpro/.atom/packages/linter-julia/lib/index.js:96:20) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at Pipe._handle.close [as _onclose] (net.js:493:12)

at /Users/yifei-macpro/.atom/packages/linter-julia/lib/index.js:80:18
gdkrmr commented 7 years ago

I am the author of flycheck-julia which is implements Lint.jl for Emacs. After I start the server, the first couple of queries give the (probably) same error. When looking at the actual String I get back from the server, it is sometimes empty "" or contains just "[{" or an incomplete json object.

ufechner7 commented 7 years ago

This is annoying. Updated to Julia 0.6, still have this problem on Ubuntu 16.04. Any suggestion what to try fixing it?

gdkrmr commented 7 years ago

for emacs' flycheck-julia the problem appears the first ~20 seconds after starting the server, this is probably due to compilation, then everything works just fine. I observe the same behavior for atom so I think that this is Lint.jl issue but I do not think that it is critical.

gdkrmr commented 7 years ago

I finally fixed the problem for flycheck-julia, the trick was to wait until the connection gets closed by the server.

jessebett commented 7 years ago

Any fix for this?

Arcanemagus commented 5 years ago

It looks like since the last comment here this package has been entirely re-written in JavaScript, and I'll be pushing out a release shortly with several fixes. If you are on a version newer than v0.7.3 and still seeing this let us know!