jakesankey / git-history

View previous versions of any file known to git.
https://atom.io/packages/git-history
MIT License
28 stars 10 forks source link

Uncaught SyntaxError: Unexpected token #22

Closed matreyes closed 9 years ago

matreyes commented 9 years ago

[Enter steps to reproduce below:]

  1. selecting history for a random file...

Atom Version: 0.210.0 System: Mac OS X 10.10.3 Thrown From: git-history package, v3.0.0

Stack Trace

Uncaught SyntaxError: Unexpected token

At file:///Applications/Atom.app/Contents/Resources/app.asar/static/index.html#%7B%22locationsToOpen%22%3A%5B%7B%22pathToOpen%22%3A%22%2FUsers%2Fmatreyes%2FDesktop%2F4talent%2Fbci_solutions%22%7D%5D%2C%22bootstrapScript%22%3A%22%2FApplications%2FAtom.app%2FContents%2FResources%2Fapp.asar%2Fsrc%2Fwindow-bootstrap.js%22%2C%22resourcePath%22%3A%22%2FApplications%2FAtom.app%2FContents%2FResources%2Fapp.asar%22%2C%22devMode%22%3Afalse%2C%22safeMode%22%3Afalse%2C%22includeDeprecatedAPIs%22%3Afalse%2C%22profileStartup%22%3Afalse%2C%22appVersion%22%3A%220.210.0%22%2C%22shellLoadTime%22%3A357%2C%22initialPaths%22%3A%5B%22%2FUsers%2Fmatreyes%2FDesktop%2F4talent%2Fbci_solutions%22%5D%7D:1

SyntaxError: Unexpected token   
  at Object.parse (native)
  at stdout (/Users/matreyes/.atom/packages/git-history/lib/git-history-view.coffee:46:13)
  at Socket.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:85:13)
  at emitOne (events.js:77:13)
  at Socket.emit (events.js:166:7)
  at readableAddChunk (_stream_readable.js:146:16)
  at Socket.Readable.push (_stream_readable.js:109:10)
  at Pipe.onread (net.js:517:20)

Commands

     -0:23.1.0 fuzzy-finder:toggle-file-finder (atom-pane.pane.active)
  7x -0:22.3.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -0:15 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:09.1.0 git-plus:menu (atom-text-editor.editor.is-focused)
     -0:07.1.0 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
     -0:07.1.0 core:cancel (atom-text-editor.editor.mini.is-focused)
     -0:06.2.0 command-palette:toggle (atom-text-editor.editor.is-focused)
     -0:01.7.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:01.7.0 git-history:show-file-history (atom-text-editor.editor)

Config

{
  "core": {
    "disabledPackages": [
      "minimap"
    ]
  },
  "git-history": {}
}

Installed Packages

# User
.bin, vundefined
atom-typescript, v4.5.16
color-picker, v2.0.6
git-history, v3.0.0
git-log, v0.4.1
git-plus, v5.1.2
language-haml, v0.21.0
linter, v0.12.7
react, v0.12.0

# Dev
No dev packages
mico commented 9 years ago

same error

nappels commented 9 years ago

+1

jakesankey commented 9 years ago

Can any of you provide additional insights here? Is it always happening for you? Are you working with multiple projects in the same workspace? Any info you can provide would be helpful.

davisein commented 9 years ago

Hi @jakesankey , I'm facing the same issue. I have upgraded all packages and keeps happening. One project open only. OSX. Let me know if you need more information to reproduce. So far it's happening only for files that appear with the same name twice in the project (but not for all of them). It might not be related.

nappels commented 9 years ago

Sorry didn't reply sooner @jakesankey. Upgrading to 3.0.1 fixed the issue for me. Thanks!

pehiv commented 9 years ago

Im still having this issue (one project, only some files in a repo) .. if you need more info, let me know

Atom Version: 1.0.11 System: Linux Mint Thrown From: git-history package, v3.1.0

Stack Trace

Uncaught SyntaxError: Unexpected token

At file:///usr/share/atom/resources/app.asar/static/index.html#%7B%22locationsToOpen%22%3A%5B%7B%22pathToOpen%22%3A%22%2Fgit%2Fv3%2Fui-v3%22%7D%5D%2C%22bootstrapScript%22%3A%22%2Fusr%2Fshare%2Fatom%2Fresources%2Fapp.asar%2Fsrc%2Fwindow-bootstrap.js%22%2C%22resourcePath%22%3A%22%2Fusr%2Fshare%2Fatom%2Fresources%2Fapp.asar%22%2C%22devMode%22%3Afalse%2C%22safeMode%22%3Afalse%2C%22profileStartup%22%3Afalse%2C%22appVersion%22%3A%221.0.11%22%2C%22shellLoadTime%22%3A433%2C%22initialPaths%22%3A%5B%22%2Fgit%2Fv3%2Fui-v3%22%5D%7D:1

SyntaxError: Unexpected token   
  at Object.parse (native)
  at stdout (/home/p4/.atom/packages/git-history/lib/git-history-view.coffee:46:13)
  at Socket.<anonymous> (/usr/share/atom/resources/app.asar/src/buffered-process.js:85:13)
  at emitOne (events.js:77:13)
  at Socket.emit (events.js:166:7)
  at readableAddChunk (_stream_readable.js:146:16)
  at Socket.Readable.push (_stream_readable.js:109:10)
  at Pipe.onread (net.js:517:20)

Commands

     -7:12.1.0 core:save (atom-text-editor.editor.is-focused)
     -7:10.5.0 pane:split-down (atom-text-editor.editor)
     -6:50.3.0 application:new-file (atom-text-editor.editor)
  2x -2:06.6.0 command-palette:toggle (atom-text-editor.editor.is-focused)
  4x -1:49 git-history:show-file-history (atom-text-editor.editor.is-focused)
     -0:10.4.0 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
     -0:10.4.0 core:cancel (atom-text-editor.editor.mini.is-focused)
     -0:08.7.0 git-history:show-file-history (atom-text-editor.editor.is-focused)
     -0:07.4.0 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
     -0:07.4.0 core:cancel (atom-text-editor.editor.mini.is-focused)
     -0:06.6.0 editor:consolidate-selections (atom-text-editor.editor.is-focused)
     -0:06.6.0 core:cancel (atom-text-editor.editor.is-focused)
     -0:04.1.0 git-history:show-file-history (atom-text-editor.editor.is-focused)
     -0:02.6.0 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
     -0:02.6.0 core:cancel (atom-text-editor.editor.mini.is-focused)
     -0:00.9.0 git-history:show-file-history (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "projectHome": "/git",
    "themes": [
      "atom-material-ui",
      "atom-material-syntax"
    ],
    "disabledPackages": [
      "atom-color-highlight",
      "linter-jscs",
      "open-to-current-path",
      "open-to-current-path"
    ],
    "ignoredNames": [
      ".git",
      ".hg",
      ".svn",
      ".DS_Store",
      "._*",
      "Thumbs.db",
      "*.o",
      "*.a",
      ".deps"
    ]
  },
  "git-history": {}
}

Installed Packages

# User
angularjs, v0.3.0
atom-beautify, v0.28.12
atom-jshint, v2.0.0
atom-material-syntax, v0.2.3
atom-material-ui, v0.6.0
autocomplete-clang, v0.8.7
color-picker, v2.0.11
flex-tool-bar, v0.5.0
git-difftool, v0.2.6
git-history, v3.1.0
git-log, v0.4.1
highlight-selected, v0.10.1
language-gcs, v0.1.0
language-generic-config, v0.2.0
line-diff-details, v1.1.2
linter, v1.5.1
linter-clang, v3.2.1
linter-csslint, v1.0.5
linter-gjslint, v0.0.5
linter-jshint, v1.2.0
linter-less, v2.1.0
linter-php, v1.0.3
linter-pylint, v1.0.0
linter-tidy, v1.0.1
minimap, v4.13.3
minimap-git-diff, v4.1.8
open-recent, v2.3.0
open-sesame, v0.4.0
opened-files, v0.2.5
pigments, v0.14.0
save-session, v0.15.7
text-manipulation, v0.6.0
tool-bar, v0.1.9

# Dev
No dev packages
pehiv commented 9 years ago

P.S. My git commits usually contain characters which need to be escaped within a json string .. I'm assuming thats the issue

nappels commented 9 years ago

I'm actually still seeing this as well. The strange thing is that it's working for some files and not for others. I'm not seeing any pattern with file name characters either.

ChowSinWon commented 9 years ago

i just did some refactoring of my previous code and added some more escaping. i can't see any more possibilites concerning unescaped strings, so hopefully the problem is gone. JSON.parse() now (really) should not receive any more invalid JSON strings.

could you please see if you are still experiencing the issue with my fix (https://github.com/ChowSinWon/git-history/commit/59d2d9c123378bd98b1ccb511bedb4aaee29f590)?

opensourceportfolio commented 8 years ago

Just ran into that as well

niksite commented 8 years ago

Just happened on git-history 3.2.0.

Fixed it by reducing "Max Commit" setting from 100 to 37. Probably, it does not like my 38th commit message (which message is pretty normal) or some buffer was overfilled by some reason.