SyntaxError in Atom source


#1

I’m getting the following error from the Settings when I try to browse/search for packages or themes

/Applications/Atom.app/Contents/Resources/app/apm/node_modules/atom-package-manager/bin/apm:5

initialCwd=`pwd -P`
           ^

SyntaxError: Unexpected token ILLEGAL
    at exports.runInThisContext (vm.js:69:16)
    at Module._compile (module.js:438:25)
    at Object.Module._extensions..js (module.js:473:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:496:10)
    at startup (node.js:129:16)
    at node.js:1037:3

Fetching featured packages and themes failed
"Fetching featured packages and themes failed."
#2

I had the same problem when I updated from 0.68 to 0.69.

I solved it by deleting the ~/.atom/packages/settings-view folder.


#3

I get another error in the Debugger Toolbar for Atom.app/Contents/Resources/app/static/index.js

require(loadSettings.bootstrapScript);

I get a SyntaxError:

SyntaxError: Expected "-" or [^\-] but end of input found.
column: 1
expected: Array[2]
found: null
line: 1
message: "Expected "-" or [^\-] but end of input found."
name: "SyntaxError"
offset: 0
__proto__: ctor

Tracing this error further to Atom.app/Contents/Resources/app/src/window-bootstrap.js, this line causes the error:
atom.startEditorWindow();


#4

I figured it out, it was something in my keymap file that caused this and prevented Atom from loading completely.

An invalid keymapping probably shouldn’t prevent Atom from loading.


#5

Can you give a minimum repro so that @ProbablyCorey or one of the other Atom devs can hunt this down and kill it?


#6

Sure, in keymap.cson add a binding, like:

'body':
  '':'pane:reopen-closed-item'

Then reload the window, and the error will appear.