jupyter / atom-notebook

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

"Failed to load the jupiter-notebook package": Unexpected token #30

Closed aechase closed 8 years ago

aechase commented 8 years ago
  1. I successfully installed the developer version (thanks to advice gleaned from #23):
git clone https://github.com/jupyter/atom-notebook.git
cd atom-notebook
PYTHON=python2.7 apm install
apm link
  1. When I open Atom, I get the following failure-to-load error. The error message links me to #8, but I don't think these issues are actually the same.
  2. I also tried uninstalling the package in Atom, and then reinstalling via PYTHON=python2.7 apm install jupyter-notebook (that is, downloading the package and not using the cloned repo). I still get the same error.

Atom Version: 1.4.0 System: Mac OS X 10.11.2 Thrown From: jupyter-notebook package, v0.0.8

Stack Trace

Failed to load the jupyter-notebook package

At Unexpected token .

SyntaxError: Unexpected token .
    at Module._compile (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:77:42)
    at Object.defineProperty.value [as .js] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at Object.<anonymous> (/Users/alexchase/atom-notebook/node_modules/jupyter-js-services/node_modules/jupyter-js-utils/lib/dialog.js:3:1)
    at Module._compile (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .js] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at Object.<anonymous> (/Users/alexchase/atom-notebook/node_modules/jupyter-js-services/node_modules/jupyter-js-utils/lib/index.js:7:10)
    at Module._compile (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .js] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at Object.<anonymous> (/Users/alexchase/atom-notebook/node_modules/jupyter-js-services/lib/config.js:3:13)
    at Module._compile (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .js] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:50:27)
    at Object.<anonymous> (/Users/alexchase/atom-notebook/node_modules/jupyter-js-services/lib/index.js:7:10)
    at Module._compile (/Applications/Atom.app/Contents/Resources/app.asar/src/native-compile-cache.js:103:30)
    at Object.defineProperty.value [as .js] (/Applications/Atom.app/Contents/Resources/app.asar/src/compile-cache.js:208:21)

Commands

Config

{
  "core": {}
}

Installed Packages

# User
jupyter-notebook, v0.0.8

# Dev
No dev packages
maxxk commented 8 years ago

If you write require('<path-to-sources>/atom-notebook/lib/main.js') in Atom devtools console, it gives the location of error: atom-notebook/node_modules/jupyter-js-services/node_modules/jupyter-js-utils/lib/dialog.css:6

It is probably related to: https://github.com/jupyter/jupyter-js-utils/blob/master/src/dialog.ts#L8

gnestor commented 8 years ago

Opened an issue at https://github.com/jupyter/jupyter-js-utils/issues/20

blink1073 commented 8 years ago

Right, all of the jupyter-js-* repos assume the ability to require() a css file by name, which is provided by loaders such as Webpack and SystemJS, I'll update the readme to reflect this.

gnestor commented 8 years ago

Interesting... I'm not running into this problem but @maxxk is. We're obviously not running Webpack or SystemJS in atom-notebook, we're simply importing/requiring jupyter-js-services (https://github.com/jupyter/atom-notebook/blob/f185c49f646f15db2371e4307ac493c232c85d12/lib/notebook-editor.js#L12). Any ideas??

blink1073 commented 8 years ago

Jupyter-js-services relies on jupyter-js-utils, which as a require()d css file, dialog.css.

blink1073 commented 8 years ago

I think this may warrant splitting utils into those requiring css and those not requiring it, so that jupyter-js-services can continue to be used in a node context.

gnestor commented 8 years ago

Agreed. Let me know if you need my assistance 👍

blink1073 commented 8 years ago

@jasongrout, shall we make another repo called something like jupyter-js-graphical-utils or jupyter-js-visual-utils?

blink1073 commented 8 years ago

@minrk, same question ^^

minrk commented 8 years ago

@blink1073 for things like the dialogs? I suppose so, since they are used by multiple applications. I might say gui-utils.

blink1073 commented 8 years ago

Yep, anything that requires the DOM or css, gui-utils sounds good.

jasongrout commented 8 years ago

We just made https://github.com/jupyter/jupyter-js-domutils. @blink1073 - you have permission to push to it.

blink1073 commented 8 years ago

Should be fixed by depending on "jupyter-js-utils": "^0.4.0".

gnestor commented 8 years ago

Great! @blink1073 atom-notebook depends on jupyter-js-services, so would you like to me to submit a PR of jupyter-js-services that depends on this new version of jupyter-js-utils? Or would you like to do it?

blink1073 commented 8 years ago

Oh, sorry, that should say "jupyter-js-services": "^0.4.0", which already depends on the updated js-utils.

gnestor commented 8 years ago

👌

gnestor commented 8 years ago

@aechase @maxxk https://github.com/jupyter/atom-notebook/commit/ee702cecd93f65f6e326978f8e8eaff2bc1a0155 should fix this. Either update jupyter-notebook to 0.0.9 inside of Atom or clone the current repo. Let me know if this solves it...

aechase commented 8 years ago

@gnestor Solved! I can now install and load using PYTHON=python2.7 apm install jupyter-notebook. Thanks for the quick work, everyone.

gnestor commented 8 years ago

👍