Peekmo / atom-autocomplete-php

Autocomplete for PHP in atom editor
MIT License
136 stars 34 forks source link

Uncaught SyntaxError: Unexpected end of JSON input #303

Closed redimongo closed 7 years ago

redimongo commented 8 years ago

this is the error I am getting

file:///Applications/Atom.app/Contents/Resources/app.asar/static/index.html#%7B%22initialPaths%22%3A%5B%22%2FUsers%2Frussellharrower%2FSites%2Fipet%22%5D%2C%22locationsToOpen%22%3A%5B%7B%22pathToOpen%22%3A%22%2FUsers%2Frussellharrower%2FSites%2Fipet%22%2C%22initialLine%22%3Anull%2C%22initialColumn%22%3Anull%2C%22forceAddToWindow%22%3Afalse%7D%5D%2C%22windowInitializationScript%22%3A%22%2FApplications%2FAtom.app%2FContents%2FResources%2Fapp.asar%2Fsrc%2Finitialize-application-window.js%22%2C%22resourcePath%22%3A%22%2FApplications%2FAtom.app%2FContents%2FResources%2Fapp.asar%22%2C%22devMode%22%3Afalse%2C%22safeMode%22%3Afalse%2C%22profileStartup%22%3Afalse%2C%22clearWindowState%22%3Afalse%2C%22env%22%3A%7B%22TMPDIR%22%3A%22%2Fvar%2Ffolders%2F37%2Fgzk1h8dd58s39xdm996ks67h0000gn%2FT%2F%22%2C%22__CF_USER_TEXT_ENCODING%22%3A%220x1F5%3A0x0%3A0xF%22%2C%22HOME%22%3A%22%2FUsers%2Frussellharrower%22%2C%22SHELL%22%3A%22%2Fbin%2Fbash%22%2C%22Apple_PubSub_Socket_Render%22%3A%22%2Fprivate%2Ftmp%2Fcom.apple.launchd.R54t6OizYx%2FRender%22%2C%22SSH_AUTH_SOCK%22%3A%22%2Fprivate%2Ftmp%2Fcom.apple.launchd.l8ii3j2Q4N%2FListeners%22%2C%22PATH%22%3A%22%2Fusr%2Fbin%3A%2Fbin%3A%2Fusr%2Fsbin%3A%2Fsbin%22%2C%22LOGNAME%22%3A%22russellharrower%22%2C%22XPC_SERVICE_NAME%22%3A%22com.github.atom.14356%22%2C%22USER%22%3A%22russellharrower%22%2C%22SECURITYSESSIONID%22%3A%22186a6%22%2C%22XPC_FLAGS%22%3A%220x0%22%2C%22GOOGLE_API_KEY%22%3A%22AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q%22%2C%22ATOM_HOME%22%3A%22%2FUsers%2Frussellharrower%2F.atom%22%7D%2C%22appVersion%22%3A%221.12.3%22%2C%22atomHome%22%3A%22%2FUsers%2Frussellharrower%2F.atom%22%7D:1 Show Stack Trace The error was thrown from the atom-autocomplete-php package. You can help by creating an issue. Please explain what actions triggered this error.

tomoat commented 7 years ago

image

SyntaxError: Unexpected end of JSON input
    at Object.parse (native)
    at ChildProcess.<anonymous> (/Users/tomato/.atom/packages/atom-autocomplete-php/lib/services/php-proxy.coffee:83:52)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
sharifzadesina commented 7 years ago

When we can have this fixed? :D I have disabled the package for this issue.

josebailo commented 7 years ago

Maybe this could help. It's what the error throws on my atom's console...

error

achton commented 7 years ago

I've disabled this package as well for the same reason, but even when disabled I still get this SyntaxError alert whenever I save a PHP file.

My stack trace:

SyntaxError: Unexpected end of JSON input
    at Object.parse (native)
    at ChildProcess.<anonymous> (/home/user/.atom/packages/atom-autocomplete-php/lib/services/php-proxy.coffee:83:52)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:493:12)

Bonus info: It seems this change is the cause. Downgrading to v0.20.1 fixes the issue for me.

Peekmo commented 7 years ago

It happens when you have a fatal error in your code or something not executable in console.

I'll try to find a way to hide it, but the autocomplete will not work when you have this kind of error.

Peekmo commented 7 years ago

Hello,

Should be fixed.