jupyter / atom-notebook

[Deprecated] Jupyter Notebook, but inside Atom.
MIT License
306 stars 48 forks source link

Uncaught TypeError: Cannot read property 'map' of undefined #13

Closed DTRAN-DATTO closed 8 years ago

DTRAN-DATTO commented 8 years ago

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.2.4 System: Mac OS X 10.11.1 Thrown From: jupyter-notebook package, v0.0.3

Stack Trace

Uncaught TypeError: Cannot read property 'map' of undefined

At /Users/duy/other/git/atom-notebook/lib/notebook-editor.js:268

TypeError: Cannot read property 'map' of undefined
    at NotebookEditor.loadNotebookFile (/Users/duy/other/git/atom-notebook/lib/notebook-editor.js:268:42)
    at new NotebookEditor (/Users/duy/other/git/atom-notebook/lib/notebook-editor.js:41:12)
    at openURI (/Users/duy/other/git/atom-notebook/lib/main.js:71:80)
    at Workspace.module.exports.Workspace.openURIInPane (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:454:22)
    at Workspace.module.exports.Workspace.open (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:393:19)
    at TreeView.module.exports.TreeView.openSelectedEntry (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/tree-view/lib/tree-view.js:736:31)
    at TreeView.module.exports.TreeView.entryClicked (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/tree-view/lib/tree-view.js:462:18)
    at tree-view-file.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/tree-view/lib/tree-view.js:183:26)
    at space-pen-div.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4435:9)
    at space-pen-div.elemData.handle (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/jquery/dist/jquery.js:4121:28)

Commands

     -2:34.1.0 core:paste (atom-pane.pane.active)
     -1:29 tree-view:remove (span.name.icon.icon-file-text)

Config

{
  "core": {}
}

Installed Packages

# User
api-workbench, v0.8.6
jupyter-notebook, v0.0.3
linter, v1.11.3
linter-reek, v2.1.0
react, v0.12.10

# Dev
No dev packages
gnestor commented 8 years ago

The offending line: https://github.com/jupyter/atom-notebook/blob/19245eea52aeccf945e0aca25115c9a67f2f7516/lib/notebook-editor.js#L268

Can you paste the contents of your notebook file? It looks like it doesn't have a cells property...did you try to open an empty ipynb file?

gnestor commented 8 years ago

https://github.com/jupyter/atom-notebook/commit/929f08d0ff925fc321fefbcc16906f5776c9e092 should fix this. Test against atom-notebook 0.0.4 and let me know for sure.