Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript Error: window.PyViz.plot_index is undefined #22

Closed
timothymillar opened this issue Nov 9, 2018 · 8 comments
Closed

Javascript Error: window.PyViz.plot_index is undefined #22

timothymillar opened this issue Nov 9, 2018 · 8 comments

Comments

@timothymillar
Copy link

This is may already be fixed with #20 but thought it was worth reporting.

As in title I'm getting Javascript Error: window.PyViz.plot_index is undefined when plotting with Holoviews in Jupyterlab. Plot is fine in classic view.

versions:

jupyter                   1.0.0                    py36_7
jupyter_client            5.2.3                    py36_0
jupyter_console           6.0.0                    py36_0
jupyter_core              4.4.0                    py36_0
jupyterhub                0.9.4                    py36_0    conda-forge
jupyterhub-ldapauthenticator 1.2.2                     <pip>
jupyterlab                0.35.4                   py36_0    conda-forge
jupyterlab_server         0.2.0                      py_0    conda-forge


JupyterLab v0.35.4
@jupyterlab/hub-extension v0.12.0  enabled  OK
@pyviz/jupyterlab_pyviz v0.6.3  enabled  OK
@philippjfr
Copy link
Member

Thanks for the report, could you mention what context this happened in? Were you updating a dynamic plot? I can only see it reaching that branch of code if that's the case and I don't quite understand how you could get that far without something else breaking.

@timothymillar
Copy link
Author

A simple test notebook:

screen shot 2018-11-09 at 2 44 41 pm

I'm just trying to setup jupyterhub with lab at the moment so quite possible something else causing an issue.

I tried rolling back to v0.6.2 (seems to be most recent full release?) but had the same issue.

Thanks for the quick response!

@philippjfr
Copy link
Member

philippjfr commented Nov 9, 2018

Thanks, could you also report your holoviews version and if you have a minute see if the problem persists with a current dev version installed with: conda install -c pyviz/label/dev holoviews.

@timothymillar
Copy link
Author

Sorry, should have had that in the initial report.

The version I was using:

holoviews                 1.10.4
bokeh                     0.12.16
matplotlib                2.2.2
ipykernel                 4.8.2
ipython                   6.4.0

I created a new env but got the same issue:

holoviews                 1.11.0a10
bokeh                     1.0.0
matplotlib                3.0.1
ipykernel                 5.1.0
ipython                   7.1.1

Just a note on my setup, I have a single environment for running jupyterhub/lab which is connecting to these other environments via kernelspecs.

I'm using Firefox but get similar errors in chrome:
screen shot 2018-11-12 at 9 44 35 am

and safari:
screen shot 2018-11-12 at 9 45 01 am

Its possible there was an issue with deploying the hub/lab environment so I'll try to re-deploy that

@timothymillar
Copy link
Author

After redeploying I still have the same issue but I think it's likely an issue installing the node packages based on the warnings (I'm not familiar with node so unsure how problematic these are):

Installing @pyviz/jupyterlab_pyviz:

$ jupyter labextension install @pyviz/jupyterlab_pyviz
Node v6.13.1

> /workspace/jupyterhub/bin/npm pack @pyviz/jupyterlab_pyviz
pyviz-jupyterlab_pyviz-0.6.3.tgz
Node v6.13.1

> node /workspace/jupyterhub/lib/python3.6/site-packages/jupyterlab/staging/yarn.js install
yarn install v1.9.4
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
warning css-loader > cssnano > autoprefixer > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning css-loader > cssnano > postcss-merge-rules > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning css-loader > cssnano > postcss-merge-rules > caniuse-api > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
[3/5] Fetching packages...
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning "@jupyterlab/vdom-extension > @nteract/transform-vdom@1.1.1" has incorrect peer dependency "react@^15.6.1".
[5/5] Building fresh packages...
success Saved lockfile.
warning Your current version of Yarn is out of date. The latest version is "1.12.3", while you're on "1.9.4".
Done in 195.67s.
> node /workspace/jupyterhub/lib/python3.6/site-packages/jupyterlab/staging/yarn.js run build
yarn run v1.9.4
$ webpack
Hash: b959a56436c1d6f2bfae
Version: webpack 4.12.2
Time: 58614ms
Built at: 11/12/2018 11:16:11 AM
                                   Asset       Size        Chunks             Chunk Names
    vendors~vega.112816f82007d4165fcb.js   2.78 MiB  vendors~vega  [emitted]  vendors~vega
    674f50d287a8c48dc19ba404d20fe713.eot    162 KiB                [emitted]
    912ec66d7572ff821749319396470bde.svg    434 KiB                [emitted]
   fee66e712a8a08eef5805a46892932ad.woff   95.7 KiB                [emitted]
    b06871f281fee6b241d60582ae9369b9.ttf    162 KiB                [emitted]
            main.3b20727a44a8b72cdd1f.js   53.3 KiB          main  [emitted]  main
               0.cc98107762fcc28532b3.js    4.5 KiB             0  [emitted]
            vega.91b98e783d16fd1b9e23.js  519 bytes          vega  [emitted]  vega
    vendors~main.ba57e73120d6c800fcbb.js   8.37 MiB  vendors~main  [emitted]  vendors~main
  af7ae505a9eed503f8b8e6982036873e.woff2   75.4 KiB                [emitted]
               1.055322dcf6c2bb19185f.js    888 KiB             1  [emitted]
        main.3b20727a44a8b72cdd1f.js.map     62 KiB          main  [emitted]  main
           0.cc98107762fcc28532b3.js.map   5.73 KiB             0  [emitted]
        vega.91b98e783d16fd1b9e23.js.map  251 bytes          vega  [emitted]  vega
vendors~main.ba57e73120d6c800fcbb.js.map   9.67 MiB  vendors~main  [emitted]  vendors~main
vendors~vega.112816f82007d4165fcb.js.map    2.2 MiB  vendors~vega  [emitted]  vendors~vega
           1.055322dcf6c2bb19185f.js.map   1.04 MiB             1  [emitted]
                              index.html   1.54 KiB                [emitted]
Entrypoint main = vendors~main.ba57e73120d6c800fcbb.js vendors~main.ba57e73120d6c800fcbb.js.map main.3b20727a44a8b72cdd1f.js main.3b20727a44a8b72cdd1f.js.map
 [0] multi whatwg-fetch ./build/index.out.js 40 bytes {main} [built]
 [1] vertx (ignored) 15 bytes {main} [optional] [built]
 [2] util (ignored) 15 bytes {main} [built]
 [4] buffer (ignored) 15 bytes {main} [optional] [built]
 [5] crypto (ignored) 15 bytes {main} [optional] [built]
 [6] readable-stream (ignored) 15 bytes {main} [built]
 [8] chalk (ignored) 15 bytes {main} [built]
 [9] fs (ignored) 15 bytes {main} [built]
[10] node-fetch (ignored) 15 bytes {vega} [built]
[11] fs (ignored) 15 bytes {vega} [built]
 [ANye] ./build/index.out.js 35 KiB {main} [built]
 [RnhZ] ./node_modules/moment/locale sync ^\.\/.*$ 2.88 KiB {main} [optional] [built]
 [YuTi] (webpack)/buildin/module.js 497 bytes {vendors~main} [built]
 [eTbV] ./node_modules/codemirror/mode sync ^\.\/.*\.js$ 2.78 KiB {0} [built]
 [yLpj] (webpack)/buildin/global.js 489 bytes {vendors~main} [built]
    + 2318 hidden modules

WARNING in vega-lite
  Multiple versions of vega-lite found:
    2.5.1 ./~/vega-lite/build/src from ./~/vega-lite/build/src/compile/selection/selection.js
    2.6.0 ./~/vega-lite/build from ./~/vega-lite/build/src/index.js

Check how you can resolve duplicate packages:
https://github.com/darrenscerri/duplicate-package-checker-webpack-plugin#resolving-duplicate-packages-in-your-bundle

Child html-webpack-plugin for "index.html":
     1 asset
    Entrypoint undefined = index.html
    [KTNU] ./node_modules/html-loader!./templates/partial.html 567 bytes {0} [built]
    [YuTi] (webpack)/buildin/module.js 497 bytes {0} [built]
    [aS2v] ./node_modules/html-webpack-plugin/lib/loader.js!./templates/template.html 1.22 KiB {0} [built]
    [yLpj] (webpack)/buildin/global.js 489 bytes {0} [built]
        + 1 hidden module
Done in 64.59s.

Then Installing @jupyterlab/hub-extension:

$ jupyter labextension install @jupyterlab/hub-extension
Node v6.13.1

> /workspace/jupyterhub/bin/npm pack @jupyterlab/hub-extension
jupyterlab-hub-extension-0.12.0.tgz
Node v6.13.1

> node /workspace/jupyterhub/lib/python3.6/site-packages/jupyterlab/staging/yarn.js install
yarn install v1.9.4
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
warning css-loader > cssnano > autoprefixer > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning css-loader > cssnano > postcss-merge-rules > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning css-loader > cssnano > postcss-merge-rules > caniuse-api > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
[3/5] Fetching packages...
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning "@jupyterlab/vdom-extension > @nteract/transform-vdom@1.1.1" has incorrect peer dependency "react@^15.6.1".
[5/5] Building fresh packages...
success Saved lockfile.
Done in 83.83s.
> node /workspace/jupyterhub/lib/python3.6/site-packages/jupyterlab/staging/yarn.js run build
yarn run v1.9.4
$ webpack
Hash: 790ac521b00bb198a2f9
Version: webpack 4.12.2
Time: 64570ms
Built at: 11/12/2018 11:20:44 AM
                                   Asset       Size        Chunks             Chunk Names
    vendors~vega.112816f82007d4165fcb.js   2.78 MiB  vendors~vega  [emitted]  vendors~vega
    674f50d287a8c48dc19ba404d20fe713.eot    162 KiB                [emitted]
    912ec66d7572ff821749319396470bde.svg    434 KiB                [emitted]
   fee66e712a8a08eef5805a46892932ad.woff   95.7 KiB                [emitted]
    b06871f281fee6b241d60582ae9369b9.ttf    162 KiB                [emitted]
            main.e7a4b2150e5a48d2f254.js   54.2 KiB          main  [emitted]  main
               0.cc98107762fcc28532b3.js    4.5 KiB             0  [emitted]
            vega.91b98e783d16fd1b9e23.js  519 bytes          vega  [emitted]  vega
    vendors~main.4a53d4c974e3a59c8cff.js   8.37 MiB  vendors~main  [emitted]  vendors~main
  af7ae505a9eed503f8b8e6982036873e.woff2   75.4 KiB                [emitted]
               1.055322dcf6c2bb19185f.js    888 KiB             1  [emitted]
        main.e7a4b2150e5a48d2f254.js.map   63.2 KiB          main  [emitted]  main
           0.cc98107762fcc28532b3.js.map   5.73 KiB             0  [emitted]
        vega.91b98e783d16fd1b9e23.js.map  251 bytes          vega  [emitted]  vega
vendors~main.4a53d4c974e3a59c8cff.js.map   9.68 MiB  vendors~main  [emitted]  vendors~main
vendors~vega.112816f82007d4165fcb.js.map    2.2 MiB  vendors~vega  [emitted]  vendors~vega
           1.055322dcf6c2bb19185f.js.map   1.04 MiB             1  [emitted]
                              index.html   1.54 KiB                [emitted]
Entrypoint main = vendors~main.4a53d4c974e3a59c8cff.js vendors~main.4a53d4c974e3a59c8cff.js.map main.e7a4b2150e5a48d2f254.js main.e7a4b2150e5a48d2f254.js.map
 [0] multi whatwg-fetch ./build/index.out.js 40 bytes {main} [built]
 [1] vertx (ignored) 15 bytes {main} [optional] [built]
 [4] buffer (ignored) 15 bytes {main} [optional] [built]
 [5] crypto (ignored) 15 bytes {main} [optional] [built]
 [6] readable-stream (ignored) 15 bytes {main} [built]
 [7] supports-color (ignored) 15 bytes {main} [built]
 [8] chalk (ignored) 15 bytes {main} [built]
 [9] fs (ignored) 15 bytes {main} [built]
[10] node-fetch (ignored) 15 bytes {vega} [built]
[11] fs (ignored) 15 bytes {vega} [built]
 [ANye] ./build/index.out.js 35.9 KiB {main} [built]
 [RnhZ] ./node_modules/moment/locale sync ^\.\/.*$ 2.88 KiB {main} [optional] [built]
 [YuTi] (webpack)/buildin/module.js 497 bytes {vendors~main} [built]
 [eTbV] ./node_modules/codemirror/mode sync ^\.\/.*\.js$ 2.78 KiB {0} [built]
 [yLpj] (webpack)/buildin/global.js 489 bytes {vendors~main} [built]
    + 2319 hidden modules

WARNING in vega-lite
  Multiple versions of vega-lite found:
    2.5.1 ./~/vega-lite/build/src from ./~/vega-lite/build/src/compile/selection/selection.js
    2.6.0 ./~/vega-lite/build from ./~/vega-lite/build/src/index.js

Check how you can resolve duplicate packages:
https://github.com/darrenscerri/duplicate-package-checker-webpack-plugin#resolving-duplicate-packages-in-your-bundle

Child html-webpack-plugin for "index.html":
     1 asset
    Entrypoint undefined = index.html
    [KTNU] ./node_modules/html-loader!./templates/partial.html 567 bytes {0} [built]
    [YuTi] (webpack)/buildin/module.js 497 bytes {0} [built]
    [aS2v] ./node_modules/html-webpack-plugin/lib/loader.js!./templates/template.html 1.22 KiB {0} [built]
    [yLpj] (webpack)/buildin/global.js 489 bytes {0} [built]
        + 1 hidden module
Done in 69.36s.

Final state :

$ jupyter labextension list
JupyterLab v0.35.4
Known labextensions:
   app dir: /powerplant/workspace/jupyterhub/share/jupyter/lab
        @jupyterlab/hub-extension v0.12.0  enabled  OK
        @pyviz/jupyterlab_pyviz v0.6.3  enabled  OK

@philippjfr
Copy link
Member

Thanks for investigating this further. That's really frustrating, looking at those errors I don't see anything that would indicate there being a problem building the extension. If you could do me one more favor, would you mind loading JupyterLab, running hv.extension('bokeh') and then going to the browser JS console and checking whether window.PyViz or window.HoloViews are defined at all?

@timothymillar
Copy link
Author

No worries, thanks again for your help!

Looks like they are both defined (and window.HoloViews has plot_index):

>>window.Bokeh
Object { version: "1.0.0", embed: {…}, protocol: {…}, _testing: {…}, logger: {…}, set_log_level: set_log_level()
, settings: {…}, Models: Models()
, index: {}, documents: [], … }

>> window.HoloViews
Object { init_slider: init_slider()
, init_dropdown: init_dropdown(), comms: {}, comm_status: {}, index: {}, plot_index: {}, kernels: {}, receivers: {}, MPLSelectionWidget: MPLSelectionWidget(), MPLScrubberWidget: MPLScrubberWidget(), … }

>> window.PyViz
Object { kernels: {…}, init_slider: init_slider()
, init_dropdown: init_dropdown(), comm_manager: {} }

@philippjfr
Copy link
Member

This issue seems to have gone away, please reopen if it persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants