noseglid / atom-build

:hammer: Build your project directly from the Atom editor
https://atom.io/packages/build
MIT License
248 stars 97 forks source link

Cannot read property 'split' of undefined #532

Closed ShayBox closed 6 years ago

ShayBox commented 6 years ago
TypeError: Cannot read property 'split' of undefined
    at Object.humanizeEventName (C:\Users\Shay\AppData\Local\atom\app-1.21.0-beta0\resources\app\node_modules\underscore-plus\lib\underscore-plus.js:196:29)
    at extractDescriptor (C:\Users\Shay\AppData\Local\atom\app-1.21.0-beta0\resources\app\src\command-registry.js:447:74)
    at new SelectorBasedListener (C:\Users\Shay\AppData\Local\atom\app-1.21.0-beta0\resources\app\src\command-registry.js:414:29)
    at CommandRegistry.addSelectorBasedListener (C:\Users\Shay\AppData\Local\atom\app-1.21.0-beta0\resources\app\src\command-registry.js:163:36)
    at CommandRegistry.add (C:\Users\Shay\AppData\Local\atom\app-1.21.0-beta0\resources\app\src\command-registry.js:152:25)
    at file:///D:/Files/.atom/packages/build/lib/target-manager.js:113:54
    at Array.forEach (native)
    at file:///D:/Files/.atom/packages/build/lib/target-manage

.atom-build.json (An example/template)

{
  "cmd": "echo default Atom build, cmd-alt-b OR ctrl-alt-b => See https://atom.io/packages/build",
  "__comment": {
    "name": "<name of target>",
    "args": [ "<argument1>", "<argument2>"],
    "sh": true,
    "cwd": "<current working directory for `cmd`>",
    "env": {
      "VARIABLE1": "VALUE1",
      "VARIABLE2": "VALUE2"
    },
    "errorMatch": "^regexp$"
  },
  "targets": {
    "build-target-1": {
      "cmd": "echo atom build-target-1 => cmd-alt-t OR ctrl-alt-t"
    },
    "build-target-2": {
      "cmd": "echo atom build-target-2 => cmd-alt-t OR ctrl-alt-t"
    },
    "build-target-3": {
      "cmd": "echo atom build-target-3 => cmd-alt-t OR ctrl-alt-t"
    }
  }
}

May be an issue with the json support, or it being atom-beta. but it's still an issue I get on both of my computers running atom-beta with any variation of the json config (Have not tested any other language as I don't prefer any other.)

robboten commented 6 years ago

Am having the same problem. No idea what is going on...

Ooops. Something went wrong. Cannot read property 'split' of undefined Hide Stack Trace TypeError: Cannot read property 'split' of undefined at Object.humanizeEventName (C:\Users\Robert\AppData\Local\atom\app-1.21.0-beta0\resources\app\node_modules\underscore-plus\lib\underscore-plus.js:196:29) at extractDescriptor (C:\Users\Robert\AppData\Local\atom\app-1.21.0-beta0\resources\app\src\command-registry.js:447:74) at new SelectorBasedListener (C:\Users\Robert\AppData\Local\atom\app-1.21.0-beta0\resources\app\src\command-registry.js:414:29) at CommandRegistry.addSelectorBasedListener (C:\Users\Robert\AppData\Local\atom\app-1.21.0-beta0\resources\app\src\command-registry.js:163:36) at CommandRegistry.add (C:\Users\Robert\AppData\Local\atom\app-1.21.0-beta0\resources\app\src\command-registry.js:152:25) at file:///C:/Users/Robert/.atom/packages/build/lib/target-manager.js:113:54 at Array.forEach (native) at file:///C:/Users/Robert/.atom/packages/build/lib/target-manager.js:108:18

robboten commented 6 years ago

Seems that in my case it was the beta build that messed it up somehow. Returned to stable atom and it works again.

Technoblazed commented 6 years ago

I like my atom-beta though 🤔

xHasKx commented 6 years ago

Same problem on linux:

Ooops. Something went wrong.
Cannot read property 'split' of undefined
Hide Stack Trace
TypeError: Cannot read property 'split' of undefined
    at Object.humanizeEventName (/usr/share/atom-beta/resources/app/node_modules/underscore-plus/lib/underscore-plus.js:196:29)
    at extractDescriptor (/usr/share/atom-beta/resources/app/src/command-registry.js:447:74)
    at new SelectorBasedListener (/usr/share/atom-beta/resources/app/src/command-registry.js:414:29)
    at CommandRegistry.addSelectorBasedListener (/usr/share/atom-beta/resources/app/src/command-registry.js:163:36)
    at CommandRegistry.add (/usr/share/atom-beta/resources/app/src/command-registry.js:152:25)
    at /home/hask/.atom/packages/build/lib/target-manager.js:113:54
    at Array.forEach (native)
    at /home/hask/.atom/packages/build/lib/target-manager.js:108:18
    at process._tickCallback (internal/process/next_tick.js:103:7)
Cyclic3 commented 6 years ago

It only seems to occur (on Debian/sid) when I have valid targets. By uninstalling the targets that apply to the project, but keeping ones that don't, the error disappears, replaced by a simple 'no configuration to build this file exists'

noseglid commented 6 years ago

I have a PR up for this. I've just been extremely occupied lately. I'll try and get around to merging and releasing this shortly.