Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Deployed sibling polymer element can't find bower installed elements #78

Closed
jhpedemonte opened this issue Oct 28, 2015 · 15 comments
Closed
Assignees
Milestone

Comments

@jhpedemonte
Copy link
Collaborator

For the Meetup Outreach demo, we moved some of our code out to HTML files which are siblings of the notebook file. We then import them like so:

%%html
<link rel="import" href="./dynamic-list.html">
<link rel="import" href="./upcoming-meetups.html">

The top of each of those HTML files has something like this:

<link rel="import" href="/urth_components/iron-list/iron-list.html"
    is="urth-core-import" package="PolymerElements/iron-list">
<link rel="import" href="/urth_components/paper-toggle-button/paper-toggle-button.html"
    is="urth-core-import" package="PolymerElements/paper-toggle-button#v1.0.10">
<link rel="import" href="/urth_components/paper-material/paper-material.html"
    is="urth-core-import" package="PolymerElements/paper-material">

<dom-module id="upcoming-meetups">
...

This works well in the Notebook, but doesn't when we deploy. We get the following error:

GET http://192.168.99.100:9500/files/local_dashboards/meetup-outreach/static/urth_components/iron-list/iron-list.html 404 (Not Found)
@lbustelo
Copy link
Contributor

We still need to take a look at jupyter/declarativewidgets#22 . It is strange that the relative urth_components path does not work.

@parente
Copy link
Member

parente commented Nov 3, 2015

Test again. Various things have changed in dashboards (no more bower install) that might impact behavior.

@jhpedemonte
Copy link
Collaborator Author

On current master, we moved the imports of the Polymer elements (iron-resizable-behavior, iron-list, paper-toggle-button and paper-material) to the top of dynamic-list.html and upcoming-meetups.html.

By itself, that didn't work, since we ran into problem 2 from jupyter/declarativewidgets#22. So we added a forward slash before urth_components, as seen in description above.

This works fine when running in Notebook, but breaks when running a deployed dashboard. But we get different errors than before:

screen shot 2015-11-03 at 2 09 28 pm

Related to @Lull3rSkat3r's deploy changes?

@Lull3rSkat3r
Copy link
Member

This looks like Polymer is being loaded twice because of the multiple dom-module registrations. I think it is most likely a path issue with how polymer is being loaded.

@parente
Copy link
Member

parente commented Nov 4, 2015

Try testing that locally deployed dashboard outside of Jupyter as a webserver. You can try this quickly on your Mac by:

cd dashboards/etc/notebooks/local_dashboards/whatever_the_path_is
python -m SimpleHTTPServer

and then hit http://localhost:8000/. The dashboard should load. I'd like to see if you get the same errors or different ones.

@jhpedemonte
Copy link
Collaborator Author

Updated to latest widgets and moved imports into dynamic-list.html and upcoming-meetups.html. But as advised by @deedubbu, I did not add a leading slash.

I no longer see the long list of errors, but the Upcoming Meetups list doesn't load correctly (when running in the notebook or deployed). It seems that it (eventually) gets the iron-list, but it does not load correctly with data. Talking to @deedubbu, this seems to be a timing issue (jupyter/declarativewidgets#25).

I tested the deployed dashboard using a non-Jupyter webserver and it works exactly as it does from Jupyter itself (and notebook) -- meaning, Upcoming Meetups list doesn't load, but candidates list does show when streaming.

@parente
Copy link
Member

parente commented Nov 17, 2015

For the record, the demo is working around this problem by elevating the dependency links to the notebook from of in the widget HTML files.

@parente
Copy link
Member

parente commented Nov 19, 2015

Back burnering until widget defect is resolved.

@parente
Copy link
Member

parente commented Apr 27, 2016

This probably warrants retesting both with:

  1. Local deploy
  2. Dashboard server

A short writeup on what works and what doesn't still is the first step. Might be a decl widgets issue still or might be a bundlers / dash server issue.

@parente parente modified the milestone: 0.5.1 Apr 27, 2016
@nitind
Copy link
Member

nitind commented May 10, 2016

Executing in the notebook, polymer.html itself raises status 404 errors for /urth_components/iron-list/iron-list.html, urth_components/paper-toggle-button/paper-toggle-button.html, and /urth_components/paper-material/paper-material.html.

Locally deployed, meetup-outreach is initially disabled by https://github.com/jupyter-incubator/dashboards_bundlers/blob/master/dashboards_bundlers/local_deploy/__init__.py#L175 . With 0.5.2., declarativewidgets is present instead of urth_widgets (jupyter/declarativewidgets@4e5ff1b), but there are still problems getting the dashboard to display after updating that.

@nitind
Copy link
Member

nitind commented May 10, 2016

When deployed locally, it's still 404s for /files/local_dashboards/meetup-outreach/static/urth_components/iron-list/iron-list.html as well as urth_components paper-toggle-button/paper-toggle-button.html and paper-material/paper-material.html.

@parente
Copy link
Member

parente commented May 11, 2016

Locally deployed, meetup-outreach is initially disabled by https://github.com/jupyter-incubator/dashboards_bundlers/blob/master/dashboards_bundlers/local_deploy/__init__.py#L175 .

Hm. Shouldn't be. Either the old version with the old path should work or the new one. Else we've got a backward compat bug that we shouldn't have.

With 0.5.2., declarativewidgets is present instead of urth_widgets (jupyter/declarativewidgets@4e5ff1b), but there are still problems getting the dashboard to display after updating that.

I believe the README for decl widgets 0.5.2 says it will only work with ipywidgets 5.1.x and up. Our dev containers are still using ipywidgets 4.x and I think the README in bundlers says thebe only works with 4.x anyway.

@nitind
Copy link
Member

nitind commented May 11, 2016

When the notebook server, kernel gateway, and dashboard server are running correctly, aside from a logged "Uncaught TypeError: Cannot read property 'register' of null", the dashboard works properly both deployed locally on the notebook server and on the dashboard server.

@parente
Copy link
Member

parente commented May 11, 2016

Unless you plan to do more research, I think we can close this.

@nitind
Copy link
Member

nitind commented May 11, 2016

Closing after manual test.

@nitind nitind closed this as completed May 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants