halohalospecial / atom-elmjutsu

A bag of tricks for developing with Elm. (Atom package)
https://atom.io/packages/elmjutsu
MIT License
192 stars 24 forks source link

Uncaught SyntaxError: Unexpected token / in JSON at position 0 #123

Closed fredericcormier closed 5 years ago

fredericcormier commented 5 years ago

[Enter steps to reproduce:]

  1. save elm file
  2. ...

Atom: 1.29.0 x64 Electron: 2.0.5 OS: Mac OS X 10.12.6 Thrown From: elmjutsu package 8.3.2

Stack Trace

Uncaught SyntaxError: Unexpected token / in JSON at position 0

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

SyntaxError: Unexpected token / in JSON at position 0
    at JSON.parse (<anonymous>)
    at /packages/elmjutsu/lib/elm-make.js:47:31)
    at emitTwo (events.js:131:20)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Socket.stream.socket.on (internal/child_process.js:346:11)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:554:12)

Commands

Non-Core Packages

atom-beautify 0.33.0 
atom-ide-ui 0.13.0 
atom-jasmine 0.9.1 
atom-runner 2.7.1 
auto-indent 0.5.0 
busy-signal 1.4.3 
color-picker 2.3.0 
elm-format 3.2.0 
elm-lens 0.3.0 
elmjutsu 8.3.2 
emmet 2.4.3 
file-icons 2.1.24 
go-plus 5.8.5 
goto 1.8.3 
highlight-line 0.12.0 
html-to-elm 0.2.0 
hyperclick 0.0.0 
ide-typescript 0.7.6 
intentions 1.1.5 
language-elm 1.5.0 
linter-eslint 8.4.1 
linter-jshint 3.1.8 
nord-atom-syntax 0.9.1 
nord-atom-ui 0.11.0 
northem-dark-atom-syntax 2.1.0 
northem-dark-atom-ui 2.1.0 
one-dark-matte-syntax 0.0.7 
platformio-ide-terminal 2.8.4 
project-manager 3.3.6 
script 3.18.1 
sepia-syntax 1.1.0 
spacegray-dark-syntax 0.2.0 
spacegray-light-neue-ui 0.1.7 
spacegray-light-syntax 0.1.0 
status-bar-clock 2.0.4 
Sublime-Style-Column-Selection 1.7.4 
MethodGrab commented 5 years ago

This seems to happen in 0.19 projects when it can't find the elm binary (either because you don't have it installed globally or haven't specified its path in Elmjutsu's settings).

amitaibu commented 5 years ago

It happens also on 0.18.0 -- and seems to also create an elm-package.json in every directory we save a file.

halohalospecial commented 5 years ago

@amitaibu have you tried setting the "Run elm make" option to "never"?

amitaibu commented 5 years ago

Indeed with Run elm make I no longer get those elm-package.json (however, up until now I had that set as On save, so I guess something has changed)

halohalospecial commented 5 years ago

Sorry about that. Elmjutsu now works with Elm 0.19 by default.

There's more information here: https://github.com/halohalospecial/atom-elmjutsu#error-highlighting

amitaibu commented 5 years ago

Thanks @halohalospecial - you always respond so quickly! Much appreciated :)

halohalospecial commented 5 years ago

@fredericcormier, @MethodGrab is correct. Please check the value of Elm Path in the Settings view. I'll show a notification popup in the next version. Thanks!