Uncaught SyntaxError: Unexpected token c
I'm behind a proxy, probably this is launching this error. I don't know how to set up this configuration.
Thanks
[Enter steps to reproduce below:]
- Just try to backup
Atom Version: 1.7.2 System: Ubuntu 15.10 Thrown From: sync-settings package, v0.7.2
Stack Trace
Uncaught SyntaxError: Unexpected token c
At file:///opt/atom/resources/app.asar/static/index.html#%7B%22initialPaths%22%3A%5B%22%2Fhome%2Frafael%2Fwww%2Fkiumun%2Fcore%22%2C%22%2Fhome%2Frafael%2Fcode%2Frafaelcneves.github.io%22%5D%2C%22locationsToOpen%22%3A%5B%7B%22pathToOpen%22%3A%22%2Fhome%2Frafael%2Fwww%2Fkiumun%2Fcore%22%2C%22initialLine%22%3Anull%2C%22initialColumn%22%3Anull%2C%22forceAddToWindow%22%3Afalse%7D%5D%2C%22windowInitializationScript%22%3A%22%2Fopt%2Fatom%2Fresources%2Fapp.asar%2Fsrc%2Finitialize-application-window.js%22%2C%22resourcePath%22%3A%22%2Fopt%2Fatom%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%22PATH%22%3A%22%2Fusr%2Flocal%2Fsbin%3A%2Fusr%2Flocal%2Fbin%3A%2Fusr%2Fsbin%3A%2Fusr%2Fbin%3A%2Fsbin%3A%2Fbin%3A%2Fusr%2Fgames%3A%2Fusr%2Flocal%2Fgames%3A%2Fhome%2Frafael%2F.rvm%2Fbin%22%2C%22XDG_VTNR%22%3A%227%22%2C%22LC_PAPER%22%3A%22pt_BR.UTF-8%22%2C%22XDG_SESSION_ID%22%3A%22c2%22%2C%22LC_ADDRESS%22%3A%22pt_BR.UTF-8%22%2C%22XDG_GREETER_DATA_DIR%22%3A%22%2Fvar%2Flib%2Flightdm-data%2Frafael%22%2C%22LC_MONETARY%22%3A%22pt_BR.UTF-8%22%2C%22SHELL%22%3A%22%2Fbin%2Fbash%22%2C%22LC_NUMERIC%22%3A%22pt_BR.UTF-8%22%2C%22USER%22%3A%22rafael%22%2C%22LC_TELEPHONE%22%3A%22pt_BR.UTF-8%22%2C%22XDG_SESSION_PATH%22%3A%22%2Forg%2Ffreedesktop%2FDisplayManager%2FSession0%22%2C%22XDG_SEAT_PATH%22%3A%22%2Forg%2Ffreedesktop%2FDisplayManager%2FSeat0%22%2C%22DEFAULTS_PATH%22%3A%22%2Fusr%2Fshare%2Fgconf%2Fubuntu.default.path%22%2C%22XDG_CONFIG_DIRS%22%3A%22%2Fetc%2Fxdg%2Fxdg-ubuntu%3A%2Fusr%2Fshare%2Fupstart%2Fxdg%3A%2Fetc%2Fxdg%22%2C%22DESKTOP_SESSION%22%3A%22ubuntu%22%2C%22QT_QPA_PLATFORMTHEME%22%3A%22appmenu-qt5%22%2C%22LC_IDENTIFICATION%22%3A%22pt_BR.UTF-8%22%2C%22PWD%22%3A%22%2Fhome%2Frafael%22%2C%22XDG_SESSION_TYPE%22%3A%22x11%22%2C%22LANG%22%3A%22en_US.UTF-8%22%2C%22MANDATORY_PATH%22%3A%22%2Fusr%2Fshare%2Fgconf%2Fubuntu.mandatory.path%22%2C%22GDM_LANG%22%3A%22en_US%22%2C%22NODE_PATH%22%3A%22%2Fopt%2Fatom%2Fresources%2Fapp.asar%2Fexports%22%2C%22LC_MEASUREMENT%22%3A%22pt_BR.UTF-8%22%2C%22IM_CONFIG_PHASE%22%3A%221%22%2C%22COMPIZ_CONFIG_PROFILE%22%3A%22ubuntu%22%2C%22GDMSESSION%22%3A%22ubuntu%22%2C%22SESSIONTYPE%22%3A%22gnome-session%22%2C%22GTK2_MODULES%22%3A%22overlay-scrollbar%22%2C%22SHLVL%22%3A%220%22%2C%22XDG_SEAT%22%3A%22seat0%22%2C%22HOME%22%3A%22%2Fhome%2Frafael%22%2C%22LANGUAGE%22%3A%22en_US%22%2C%22XDG_SESSION_DESKTOP%22%3A%22ubuntu%22%2C%22LOGNAME%22%3A%22rafael%22%2C%22XDG_DATA_DIRS%22%3A%22%2Fusr%2Fshare%2Fubuntu%3A%2Fusr%2Fshare%2Fgnome%3A%2Fusr%2Flocal%2Fshare%2F%3A%2Fusr%2Fshare%2F%22%2C%22LC_CTYPE%22%3A%22pt_BR.UTF-8%22%2C%22XDG_RUNTIME_DIR%22%3A%22%2Frun%2Fuser%2F1002%22%2C%22DISPLAY%22%3A%22%3A0%22%2C%22XDG_CURRENT_DESKTOP%22%3A%22Unity%22%2C%22LC_TIME%22%3A%22pt_BR.UTF-8%22%2C%22XAUTHORITY%22%3A%22%2Fhome%2Frafael%2F.Xauthority%22%2C%22LC_NAME%22%3A%22pt_BR.UTF-8%22%2C%22GTK_MODULES%22%3A%22unity-gtk-module%22%2C%22DBUS_SESSION_BUS_ADDRESS%22%3A%22unix%3Aabstract%3D%2Ftmp%2Fdbus-MRzG1MRrlm%22%2C%22GPG_AGENT_INFO%22%3A%22%2Ftmp%2Fgpg-uHXghH%2FS.gpg-agent%3A2208%3A1%22%2C%22XMODIFIERS%22%3A%22%22%2C%22GTK_IM_MODULE%22%3A%22%22%2C%22QT_IM_MODULE%22%3A%22%22%2C%22QT4_IM_MODULE%22%3A%22%22%2C%22CLUTTER_IM_MODULE%22%3A%22%22%2C%22SSH_AUTH_SOCK%22%3A%22%2Frun%2Fuser%2F1002%2Fkeyring%2Fssh%22%2C%22GNOME_KEYRING_CONTROL%22%3A%22%22%2C%22GNOME_KEYRING_PID%22%3A%22%22%2C%22GNOME_DESKTOP_SESSION_ID%22%3A%22this-is-deprecated%22%2C%22SESSION%22%3A%22ubuntu%22%2C%22JOB%22%3A%22unity-settings-daemon%22%2C%22INSTANCE%22%3A%22%22%2C%22UPSTART_EVENTS%22%3A%22xsession%20started%22%2C%22UPSTART_JOB%22%3A%22unity7%22%2C%22UPSTART_INSTANCE%22%3A%22%22%2C%22UPSTART_SESSION%22%3A%22unix%3Aabstract%3D%2Fcom%2Fubuntu%2Fupstart-session%2F1002%2F2098%22%2C%22COMPIZ_BIN_PATH%22%3A%22%2Fusr%2Fbin%2F%22%2C%22GIO_LAUNCHED_DESKTOP_FILE%22%3A%22%2Fusr%2Fshare%2Fapplications%2Fatom.desktop%22%2C%22GIO_LAUNCHED_DESKTOP_FILE_PID%22%3A%2217230%22%2C%22GOOGLE_API_KEY%22%3A%22AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q%22%2C%22CHROME_DESKTOP%22%3A%22Atom.desktop%22%2C%22ATOM_HOME%22%3A%22%2Fhome%2Frafael%2F.atom%22%2C%22NODE_ENV%22%3A%22production%22%7D%2C%22appVersion%22%3A%221.7.2%22%2C%22atomHome%22%3A%22%2Fhome%2Frafael%2F.atom%22%2C%22shellLoadTime%22%3A638%7D:1
SyntaxError: Unexpected token c
at Object.parse (native)
at /home/rafael/.atom/packages/sync-settings/lib/sync-settings.coffee:178:24
at [object Object].global.sendError (/home/rafael/.atom/packages/sync-settings/node_modules/github4/index.js:729:13)
at /home/rafael/.atom/packages/sync-settings/node_modules/github4/index.js:736:29
at callCallback (/home/rafael/.atom/packages/sync-settings/node_modules/github4/index.js:613:17)
at ClientRequest.<anonymous> (/home/rafael/.atom/packages/sync-settings/node_modules/github4/index.js:684:17)
at emitOne (events.js:77:13)
at ClientRequest.emit (events.js:169:7)
at TLSSocket.socketErrorListener (_http_client.js:265:9)
at emitOne (events.js:77:13)
at TLSSocket.emit (events.js:169:7)
at emitErrorNT (net.js:1253:8)
at doNTCallback2 (node.js:465:9)
at process._tickCallback (node.js:379:17)
Commands
-2:11.5.0 command-palette:toggle (atom-text-editor.editor.is-focused)
-2:08.7.0 core:move-down (atom-text-editor.editor.mini.is-focused)
-2:08.5.0 core:confirm (atom-text-editor.editor.mini.is-focused)
-2:08.5.0 sync-settings:backup (atom-text-editor.editor)
Config
{
"core": {
"disabledPackages": [
"blade-snippets",
"activate-power-mode",
"emmet"
],
"followSymlinks": false,
"themes": [
"atom-material-ui",
"atom-material-syntax"
]
},
"sync-settings": {
// ...
}
}
Installed Packages
# User
angularjs, v0.3.4
atom-alignment, v0.12.1
atom-beautify, v0.29.7
atom-material-syntax, v0.4.6
atom-material-ui, v1.2.10
autoclose-html, v0.23.0
color-picker, v2.1.1
file-icons, v1.7.7
highlight-selected, v0.11.2
language-blade, v0.24.1
language-docker, v1.1.6
language-haml, v0.24.0
language-htaccess, v0.1.1
linter, v1.11.4
linter-csslint, v1.3.2
linter-docker, v0.1.2
linter-erb, v1.0.2
linter-haml, v1.2.0
linter-htmlhint, v1.1.4
linter-js-yaml, v1.2.5
linter-jshint, v2.1.0
linter-jsonlint, v1.2.5
linter-less, v2.5.0
linter-php, v1.2.0
linter-ruby, v1.2.2
linter-sass-lint, v1.4.1
linter-scss-lint, v2.5.1
markdown-scroll-sync, v2.1.2
sync-settings, v0.7.2
tab-control, v0.6.9
tabs-to-spaces, v1.0.2
# Dev
No dev packages
In the above error report you have shared your personalAccessToken. You must revoke it to prevent abuse.
This looks similar to #151 and also needs more information / a reproducible example to investigate.
How do I set up the proxy for the plugin? If I can set this, I think that It will work..
Please search other issues about how to setup a proxy connection within Atom.
To work proxy settings, the HTTP_PROXY and similar enviroment vars need to be in ~/.profile or /etc/profile files, my vars was on ~/.bashrc
I'm seeing the same error under windows, and may be able to help reproduce. I'm behind a proxy and have HTTP_PROXY and HTTPS_PROXY environment variables set. Everything else related to atom/node/git/etc is working fine for me behind the proxy. @dirk-thomas -- What information can I provide to help you out here?
The first thing I noticed was that the github4 package does a case-sensitive look for HTTPS_PROXY (I had https_proxy set). After changing this I'm still getting a 500 response on the request. Is there any easy way to see what settings https-proxy-agent and github4 are using for this call?
The console log from Atom is:
error backing up data: socket hang up Object {defaultMessage: "Internal Server Error", message: "socket hang up", code: "500"}code: "500"defaultMessage: "Internal Server Error"message: "socket hang up"stack: (...)get stack: ()arguments: nullcaller: nulllength: 0name: ""prototype: aZconstructor: ()__proto__: Object__proto__: ()apply: apply()arguments: (...)get arguments: ThrowTypeError()set arguments: ThrowTypeError()bind: bind()call: call()caller: (...)get caller: ThrowTypeError()set caller: ThrowTypeError()constructor: Function()length: 0name: ""toString: toString()__proto__: Object<function scope><function scope>set stack: ()arguments: nullcaller: nulllength: 1name: ""prototype: bc__proto__: ()<function scope>__proto__: Object(anonymous function) @ sync-settings.coffee:177global.sendError @ C:\Users\amellnik\.atom\packages\sync-settings\node_modules\github4\index.js:729(anonymous function) @ C:\Users\amellnik\.atom\packages\sync-settings\node_modules\github4\index.js:736callCallback @ C:\Users\amellnik\.atom\packages\sync-settings\node_modules\github4\index.js:613(anonymous function) @ C:\Users\amellnik\.atom\packages\sync-settings\node_modules\github4\index.js:684emitOne @ events.js:77emit @ events.js:169emitErr @ C:\Users\amellnik\.atom\packages\sync-settings\node_modules\github4\node_modules\https-proxy-agent\…:83(anonymous function) @ C:\Users\amellnik\.atom\packages\sync-settings\node_modules\github4\node_modules\https-proxy-agent\…:94onerror @ C:\Users\amellnik\.atom\packages\sync-settings\node_modules\github4\node_modules\https-proxy-agent\…:104emitOne @ events.js:77emit @ events.js:169emitErrorNT @ net.js:1253doNTCallback2 @ node.js:465_tickCallback @ node.js:379
The error in node is not that helpful:
file:///C:/Users/amellnik/AppData/Local/atom/app-1.7.4/resources/app.asar/static/index.html#{{... the contents of every environment variable I have set including my very long path appear here ...}} JAVA_OPTIONS%22%3A%22-Djava.net.preferIPv4Stack%3Dtrue%22%2C%22NODE_PATH%22%3A%22C%3A%5C%5CUsers%5C%5Camellnik%5C%5CAppData%5C%5CLocal%5C%5Catom%5C%5Capp-1.7.4%5C%5Cresources%5C%5Capp.asar%5C%5Cexports%22%2C%22NODE_ENV%22%3A%22production%22%7D%2C%22appVersion%22%3A%221.7.4%22%2C%22atomHome%22%3A%22C%3A%5C%5CUsers%5C%5Camellnik%5C%5C.atom%22%2C%22shellLoadTime%22%3A459%7D:1
Hide Stack Trace
SyntaxError: Unexpected token c
at Object.parse (native)
at file:///C:/Users/amellnik/.atom/packages/sync-settings/lib/sync-settings.coffee:178:24
at [object Object].global.sendError (C:\Users\amellnik\.atom\packages\sync-settings\node_modules\github4\index.js:729:13)
at C:\Users\amellnik\.atom\packages\sync-settings\node_modules\github4\index.js:736:29
at callCallback (C:\Users\amellnik\.atom\packages\sync-settings\node_modules\github4\index.js:613:17)
at ClientRequest.<anonymous> (C:\Users\amellnik\.atom\packages\sync-settings\node_modules\github4\index.js:684:17)
at emitOne (events.js:77:13)
at ClientRequest.emit (events.js:169:7)
at TLSSocket.socketErrorListener (_http_client.js:265:9)
at emitOne (events.js:77:13)
at TLSSocket.emit (events.js:169:7)
at emitErrorNT (net.js:1253:8)
at doNTCallback2 (node.js:465:9)
at process._tickCallback (node.js:379:17)
Since I neither have Windows nor use a proxy I can't help much. Maybe other users with a similar setup can provide help how they got it to work (e.g. #142).