danieltrost / json-sort

Atom.io Package to sort JSON
1 stars 0 forks source link

Uncaught SyntaxError: Unexpected token : in JSON at position 19 #2

Closed cj-egmantas-girnis closed 5 years ago

cj-egmantas-girnis commented 6 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.27.2 x64 Electron: 1.7.15 OS: Debian GNU/Linux Thrown From: json-sort package 1.3.0

Stack Trace

Uncaught SyntaxError: Unexpected token : in JSON at position 19

At file:///usr/share/atom/resources/app.asar/static/index.html:1

SyntaxError: Unexpected token : in JSON at position 19
    at JSON.parse (<anonymous>)
    at Object.sort (/packages/json-sort/lib/json-sort.js:75:41)
    at HTMLElement.jsonSortSort (/packages/json-sort/lib/json-sort.js:24:36)
    at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:384:49)
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:621:22)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/usr/share/atom/resources/app/node_modules/atom-keymap/lib/keymap-manager.js:412:28)
    at WindowEventHandler.handleDocumentKeyEvent (/usr/share/atom/resources/app/src/window-event-handler.js:110:40)

Commands

     -0:02.7.0 json-sort:sort (atom-pane.pane)

Non-Core Packages

atom-ide-ui 0.11.1 
document-outline 2.1.1 
git-blame 1.6.0 
ide-yaml 0.4.3 
json-sort 1.3.0 
pretty-json 2.0.0 
split-diff 1.5.2 
danieltrost commented 5 years ago

Please test on version 1.6.0 and confirm if this is still an issue. Remember to select an object only. For example:

Invalid:

"someObject": {
  ...
}

Valid:

{
  ...
}