Getting error like "Cannot read property 'command' of undefined"


#1

I am using Windows7 as my operating system. Let me where am i wrong.

Code:

initialize: (serializeState) ->
atom.commands.add atom.views.getView(atom.workspace),
‘cubic-bezier:open’: (event) => @toggle()

Trace:

TypeError: Cannot read property ‘command’ of undefined
at CubicBezierView.module.exports.CubicBezierView.initialize (C:\Users\sporunan.atom\packages\cubic-bezier\lib\cubic-bezier-view.coffee:33:23)
at CubicBezierView.View (C:\Users\sporunan\AppData\Local\atom\app-1.0.5\resources\app.asar\node_modules\atom-space-pen-views\node_modules\space-pen\lib\space-pen.js:184:25)
at new CubicBezierView (C:\Users\sporunan.atom\packages\cubic-bezier\lib\cubic-bezier-view.coffee:10:3)
at Object.module.exports.activate (C:\Users\sporunan.atom\packages\cubic-bezier\lib\cubic-bezier.coffee:7:28)
at Package.module.exports.Package.activateNow (C:\Users\sporunan\AppData\Local\atom\app-1.0.5\resources\app.asar\src\package.js:243:19)


#2

Hi, I’m the author of the bezier-curve-editor package that seems at fault in your stack trace, but it also appears that you’re using a pretty old version of it (the cubic-bezier-view.coffee file was removed with v0.7.0).

I suggest you update the package and see if you still get that issue (it shouldn’t).