Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught SyntaxError: Unexpected token s #96

Closed
relifeted opened this issue Jul 6, 2015 · 9 comments
Closed

Uncaught SyntaxError: Unexpected token s #96

relifeted opened this issue Jul 6, 2015 · 9 comments

Comments

@relifeted
Copy link

[Enter steps to reproduce below:]

  1. Synchronize Settings => Backup

Atom Version: 1.0.0
System: Windows 7 64-bit Professional
Thrown From: sync-settings package, v0.5.0

Stack Trace

Uncaught SyntaxError: Unexpected token s

At file:///C:/Users/ted.chen/AppData/Local/atom/app-1.0.0/resources/app.asar/static/index.html#%7B%22locationsToOpen%22%3A%5B%7B%22pathToOpen%22%3A%22D%3A%5C%5Cworkspace%5C%5Clab%5C%5Cfreeswitch-practice%5C%5Cmplus-fs-node%22%7D%5D%2C%22bootstrapScript%22%3A%22C%3A%5C%5CUsers%5C%5Cted.chen%5C%5CAppData%5C%5CLocal%5C%5Catom%5C%5Capp-1.0.0%5C%5Cresources%5C%5Capp.asar%5C%5Csrc%5C%5Cwindow-bootstrap.js%22%2C%22resourcePath%22%3A%22C%3A%5C%5CUsers%5C%5Cted.chen%5C%5CAppData%5C%5CLocal%5C%5Catom%5C%5Capp-1.0.0%5C%5Cresources%5C%5Capp.asar%22%2C%22devMode%22%3Afalse%2C%22safeMode%22%3Afalse%2C%22appVersion%22%3A%221.0.0%22%2C%22shellLoadTime%22%3A351%2C%22initialPaths%22%3A%5B%22D%3A%5C%5Cworkspace%5C%5Clab%5C%5Cfreeswitch-practice%5C%5Cmplus-fs-node%22%5D%7D:1

SyntaxError: Unexpected token s
  at Object.parse (native)
  at C:\Users\ted.chen\.atom\packages\sync-settings\lib\sync-settings.coffee:99:24
  at Object.proto.sendError (C:\Users\ted.chen\.atom\packages\sync-settings\node_modules\github\api\v3.0.0\index.js:32:13)
  at C:\Users\ted.chen\.atom\packages\sync-settings\node_modules\github\api\v3.0.0\gists.js:180:29
  at callCallback (C:\Users\ted.chen\.atom\packages\sync-settings\node_modules\github\index.js:743:17)
  at ClientRequest.<anonymous> (C:\Users\ted.chen\.atom\packages\sync-settings\node_modules\github\index.js:809:17)
  at emitOne (events.js:77:13)
  at ClientRequest.emit (events.js:166:7)
  at TLSSocket.socketErrorListener (_http_client.js:254:9)
  at emitOne (events.js:77:13)
  at TLSSocket.emit (events.js:166:7)
  at TLSSocket.<anonymous> (_tls_wrap.js:931:16)
  at emitNone (events.js:67:13)
  at TLSSocket.emit (events.js:163:7)
  at TLSSocket._finishInit (_tls_wrap.js:506:8)

Commands

     -7:12.8.0 sync-settings:backup (atom-text-editor.editor.mini.is-focused)
  2x -6:33.7.0 core:paste (atom-text-editor#sync-settings.personalAccessToken.editor.mini.is-focused)
  6x -6:21.8.0 sync-settings:backup (atom-text-editor#sync-settings.gistId.editor.mini.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "atom-beautifier",
      "language-babel",
      "autoclose-html",
      "atom-html-preview",
      "react",
      "jsonlint",
      "project-manager",
      "linter-jshint",
      "jshint"
    ],
    "themes": [
      "one-dark-ui",
      "base16-tomorrow-dark-theme"
    ]
  },
  "sync-settings": {
    "personalAccessToken": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "gistId": "bd6321d11507ca6d2998"
  }
}

Installed Packages

# User
angularjs, v0.3.0
emmet, v2.3.12
js-refactor, v0.4.2
language-javascript-jsx, v0.3.6
language-lua, v0.9.4
linter, v1.1.0
linter-eslint, v1.0.17
linter-htmlhint, v0.0.17
linter-jsonlint, v0.1.4
linter-lua, v0.1.6
markdown-format, v2.5.1
open-recent, v2.2.4
refactor, v0.5.1
sync-settings, v0.5.0
text-manipulation, v0.6.0

# Dev
No dev packages
@jerone
Copy link
Contributor

jerone commented Jul 6, 2015

Can you provide some steps to reproduce...

@groupsky
Copy link
Contributor

groupsky commented Jul 9, 2015

From the stack trace it seems that the backup has invalid json for packages.json file. @relifeted it would be helpfull if you can provide the content of the file from your gist.

@groupsky
Copy link
Contributor

groupsky commented Jul 9, 2015

@relifeted your token is posted in public as part as Config dump generated from Atom

You must revoke it, before someone does bad things to your account!

for more info ref #98

@relifeted
Copy link
Author

it might be the firewall and SSL certificate issue, doesn't appears recently.

@chevion
Copy link

chevion commented Feb 23, 2016

I met the same problem

@dirk-thomas
Copy link
Contributor

@chevion Please provide more information like the exact version you are using as well as if you are using a proxy etc.

@michael-yx-wu
Copy link

I'm seeing the same issue when trying to backup my settings.

SyntaxError: Unexpected token s
    at Object.parse (native)
    at /Users/michaelwu/.atom/packages/sync-settings/lib/sync-settings.coffee:178:24
    at [object Object].global.sendError (/Users/michaelwu/.atom/packages/sync-settings/node_modules/github4/index.js:729:13)
    at /Users/michaelwu/.atom/packages/sync-settings/node_modules/github4/index.js:736:29
    at callCallback (/Users/michaelwu/.atom/packages/sync-settings/node_modules/github4/index.js:613:17)
    at ClientRequest.<anonymous> (/Users/michaelwu/.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)

I'm on version 0.7.2.

@dirk-thomas
Copy link
Contributor

For the record: this is a duplicate of #152.

@Kampfmoehre
Copy link

I've come across the same problem and seem to be unable to save my settings. At the second try backup works as it should. Error report below (I replaced my username in all paths with and replaced settings of the sync package with ...):

Atom Version: 1.10.0-dev-35bdaf3
Electron Version: 0.37.8
System: Debian GNU/Linux
Thrown From: sync-settings package, v0.7.2

Stack Trace

Uncaught SyntaxError: Unexpected token s

At file:///usr/local/share/atom/resources/app.asar/static/index.html#%7B%22initialPaths%22%3A%5B%22%2Fhome%2F<user>%2Fdev%2Fwoodcock%22%5D%2C%22locationsToOpen%22%3A%5B%7B%22pathToOpen%22%3A%22%2Fhome%2F<user>%2Fdev%2Fwoodcock%22%2C%22initialLine%22%3Anull%2C%22initialColumn%22%3Anull%7D%5D%2C%22windowInitializationScript%22%3A%22%2Fusr%2Flocal%2Fshare%2Fatom%2Fresources%2Fapp.asar%2Fsrc%2Finitialize-application-window.js%22%2C%22resourcePath%22%3A%22%2Fusr%2Flocal%2Fshare%2Fatom%2Fresources%2Fapp.asar%22%2C%22devMode%22%3Afalse%2C%22safeMode%22%3Afalse%2C%22windowDimensions%22%3A%7B%22x%22%3A2%2C%22y%22%3A21%2C%22width%22%3A2478%2C%22height%22%3A1349%7D%2C%22clearWindowState%22%3Afalse%2C%22appVersion%22%3A%221.10.0-dev-35bdaf3%22%2C%22atomHome%22%3A%22%2Fhome%2F<user>%2F.atom%22%7D:1

SyntaxError: Unexpected token s
    at Object.parse (native)
    at /home/<user>/.atom/packages/sync-settings/lib/sync-settings.coffee:178:24
    at global.sendError (/home/<user>/.atom/packages/sync-settings/node_modules/github4/index.js:729:13)
    at /home/<user>/.atom/packages/sync-settings/node_modules/github4/index.js:736:29
    at callCallback (/home/<user>/.atom/packages/sync-settings/node_modules/github4/index.js:613:17)
    at ClientRequest.<anonymous> (/home/<user>/.atom/packages/sync-settings/node_modules/github4/index.js:684:17)
    at emitOne (events.js:90:13)
    at ClientRequest.emit (events.js:182:7)
    at TLSSocket.socketOnEnd (_http_client.js:331:9)
    at emitNone (events.js:85:20)
    at TLSSocket.emit (events.js:179:7)
    at endReadableNT (_stream_readable.js:913:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

Commands

     -2:35.5.0 core:paste (atom-text-editor.editor.is-focused)
     -2:31.1.0 atom-beautify:beautify-editor (atom-text-editor.editor.is-focused.autocomplete-active)
     -2:29.2.0 core:save (atom-text-editor.editor.is-focused)
     -2:28.3.0 phpunit:current (atom-text-editor.editor.is-focused)
     -2:00.4.0 symbols-view:go-to-declaration (atom-text-editor.editor.is-focused)
     -1:59.3.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -1:57.2.0 key-binding-resolver:toggle (atom-text-editor.editor.is-focused)
     -1:56 editor:consolidate-selections (atom-text-editor.editor.is-focused)
     -1:56 core:cancel (atom-text-editor.editor.is-focused)
     -1:55.4.0 key-binding-resolver:toggle (atom-text-editor.editor.is-focused)
     -1:54.8.0 settings-view:open (atom-text-editor.editor.is-focused)
     -1:54.2.0 key-binding-resolver:toggle (div.panels-item)
     -1:53.2.0 settings-view:open (div.panels-item)
     -0:18.9.0 command-palette:toggle (atom-text-editor.editor.is-focused)
     -0:16 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:16 sync-settings:backup (atom-text-editor.editor)

Config

{
  "core": {
    "automaticallyUpdate": false,
    "disabledPackages": [
      "autosave",
      "welcome",
      "package-generator",
      "open-on-github",
      "bookmarks",
      "tool-bar",
      "flex-tool-bar",
      "activate-power-mode",
      "quick-file-actions"
    ],
    "ignoredNames": [
      ".git",
      ".coverage",
      "tags",
      "composer.*",
      ".tags_swap",
      "tmp"
    ],
    "packagesWithKeymapsDisabled": [
      "atom-beautify",
      "tool-bar",
      "linter",
      "atom-dark-ui",
      "highlight-line",
      "last-cursor-position",
      "phpunit",
      "php-debug"
    ],
    "projectHome": "/home/<user>/dev",
    "themes": [
      "atom-material-ui",
      "afterglow-like"
    ]
  },
  "sync-settings": {
    "_analyticsUserId": "...",
    "_lastBackupHash": "...",
    "extraFiles": [
      "projects.cson"
    ],
    "gistId": "...",
    "personalAccessToken": "..."
  }
}

Installed Packages

# User
accents-ui, v1.2.0 (inactive)
afterglow-like, v0.2.1 (active)
afterglow-monokai-syntax, v1.3.4 (inactive)
afterglow-plus, v1.6.0 (inactive)
atom-beautify, v0.29.9 (active)
atom-material-ui, v1.2.13 (active)
color-picker, v2.2.2 (active)
composer, v0.5.0 (inactive)
docblockr, v0.7.3 (active)
file-icons, v1.7.17 (active)
git-plus, v5.16.2 (active)
git-time-machine, v1.5.3 (inactive)
highlight-line, v0.11.1 (active)
isotope-ui, v2.7.1 (inactive)
json-converter, v0.2.4 (inactive)
keyboard-localization, v1.4.18 (active)
last-cursor-position, v0.9.0 (active)
linter, v1.11.14 (active)
linter-php, v1.2.0 (active)
merge-conflicts, v1.4.4 (active)
minimap, v4.24.7 (active)
minimap-git-diff, v4.3.1 (active)
php-cs-fixer, v2.5.6 (active)
php-debug, v0.2.3 (active)
phpunit, v1.2.0 (active)
pigments, v0.31.1 (active)
pinned-tabs, v0.3.1 (active)
project-manager, v2.9.7 (active)
seti-ui, v1.3.2 (inactive)
seti-ui-red, v0.13.0 (inactive)
sync-settings, v0.7.2 (active)
tree-view-git-status, v1.0.2 (active)
atom-dark-syntax, v0.27.0 (inactive)
atom-dark-ui, v0.52.0 (inactive)
atom-light-syntax, v0.28.0 (inactive)
atom-light-ui, v0.44.0 (inactive)
base16-tomorrow-dark-theme, v1.1.0 (inactive)
base16-tomorrow-light-theme, v1.1.1 (inactive)
one-dark-ui, v1.4.0 (inactive)
one-light-ui, v1.4.0 (inactive)
one-dark-syntax, v1.3.0 (inactive)
one-light-syntax, v1.3.0 (inactive)
solarized-dark-syntax, v1.0.2 (inactive)
solarized-light-syntax, v1.0.2 (inactive)
about, v1.5.3 (active)
archive-view, v0.61.1 (active)
autocomplete-atom-api, v0.10.0 (active)
autocomplete-css, v0.11.2 (active)
autocomplete-html, v0.7.2 (active)
autocomplete-plus, v2.31.1 (active)
autocomplete-snippets, v1.11.0 (active)
autoflow, v0.27.0 (inactive)
autosave, v0.23.1 (inactive)
background-tips, v0.26.1 (active)
bookmarks, v0.41.0 (inactive)
bracket-matcher, v0.82.1 (active)
command-palette, v0.38.0 (active)
deprecation-cop, v0.54.1 (active)
dev-live-reload, v0.47.0 (active)
encoding-selector, v0.22.0 (active)
exception-reporting, v0.38.1 (active)
find-and-replace, v0.201.0 (inactive)
fuzzy-finder, v1.3.0 (active)
git-diff, v1.1.0 (active)
go-to-line, v0.31.0 (inactive)
grammar-selector, v0.48.1 (active)
image-view, v0.58.2 (active)
incompatible-packages, v0.26.1 (active)
keybinding-resolver, v0.35.0 (active)
line-ending-selector, v0.5.0 (active)
link, v0.31.1 (inactive)
markdown-preview, v0.158.0 (active)
metrics, v0.53.1 (active)
notifications, v0.65.0 (active)
open-on-github, v1.2.0 (inactive)
package-generator, v1.0.0 (inactive)
settings-view, v0.240.1 (active)
snippets, v1.0.2 (active)
spell-check, v0.67.1 (active)
status-bar, v1.4.0 (active)
styleguide, v0.47.0 (active)
symbols-view, v0.113.0 (active)
tabs, v0.99.0 (active)
timecop, v0.33.2 (active)
tree-view, v0.208.1 (active)
update-package-dependencies, v0.10.0 (active)
welcome, v0.34.0 (inactive)
whitespace, v0.32.2 (active)
wrap-guide, v0.38.1 (active)
language-c, v0.52.1 (active)
language-clojure, v0.21.0 (active)
language-coffee-script, v0.47.1 (active)
language-csharp, v0.12.1 (active)
language-css, v0.37.0 (active)
language-gfm, v0.88.0 (active)
language-git, v0.14.0 (active)
language-go, v0.42.0 (active)
language-html, v0.44.1 (active)
language-hyperlink, v0.16.0 (active)
language-java, v0.23.0 (active)
language-javascript, v0.119.0 (active)
language-json, v0.18.1 (active)
language-less, v0.29.4 (active)
language-make, v0.22.2 (active)
language-mustache, v0.13.0 (active)
language-objective-c, v0.15.1 (active)
language-perl, v0.35.0 (active)
language-php, v0.37.1 (active)
language-property-list, v0.8.0 (active)
language-python, v0.45.0 (active)
language-ruby, v0.68.6 (active)
language-ruby-on-rails, v0.25.0 (active)
language-sass, v0.55.0 (active)
language-shellscript, v0.22.4 (active)
language-source, v0.9.0 (active)
language-sql, v0.22.0 (active)
language-text, v0.7.1 (active)
language-todo, v0.28.0 (active)
language-toml, v0.18.0 (active)
language-xml, v0.34.8 (active)
language-yaml, v0.26.0 (active)

# Dev
No dev packages

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

No branches or pull requests

7 participants