ome / omero-parade

OMERO.web plugin for displaying Dataset thumbnails or Plates in webclient center panel
GNU Affero General Public License v3.0
1 stars 12 forks source link

Bug: javascript not packaged in devspace #68

Closed joshmoore closed 4 years ago

joshmoore commented 4 years ago

see: https://github.com/ome/omero-parade/pull/64#issuecomment-555418832

Uncaught TypeError: omero_parade.omero_parade is not a function
    at jQuery.fn.init.load_plugin_content ((index):3024)
    at proxy (jquery-1.11.1.js:547)
    at update_plugin_content (ome.popup.js?_5.6.dev5:722)
    at HTMLBodyElement.<anonymous> (ome.popup.js?_5.6.dev5:759)
    at HTMLBodyElement.dispatch (jquery-1.11.1.js:4641)
    at HTMLBodyElement.elemData.handle (jquery-1.11.1.js:4309)
    at Object.trigger (jquery-1.11.1.js:4550)
    at HTMLBodyElement.<anonymous> (jquery-1.11.1.js:5260)
    at Function.each (jquery-1.11.1.js:383)
    at jQuery.fn.init.each (jquery-1.11.1.js:136)

@sbesson suspects this is due to the difference between virtualenv and pip -mvenv

sbesson commented 4 years ago

Similar issues had been reported with omero-figure. Retested with the following

FROM centos:7

RUN yum install -y centos-release-scl \
 && yum install -y rh-python36
RUN /opt/rh/rh-python36/root/bin/python -m venv /py3 && /py3/bin/pip install -U pip tox future wheel restructuredtext-lint
RUN /py3/bin/pip install https://github.com/ome/zeroc-ice-py-manylinux/releases/download/0.1.0/zeroc_ice-3.6.5-cp36-cp36m-manylinux2010_x86_64.whl
RUN /py3/bin/pip install scc
ENV VIRTUAL_ENV=/py3
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

RUN curl -sL https://rpm.nodesource.com/setup | bash
RUN yum install -y git nodejs
RUN npm install -g grunt

RUN python -m venv /tmp/venv1
RUN /tmp/venv1/bin/pip install git+git://github.com/snoopycrimecop/omero-figure.git@py3_ci#egg=omero-figure

RUN virtualenv /tmp/venv2
RUN /tmp/venv2/bin/pip install git+git://github.com/snoopycrimecop/omero-figure.git@py3_ci#egg=omero-figure

Installing the package confirms static templates are only generated in the first virtual environment:

[sbesson@idr2-slot3 venv_fun]$ docker build -t scl_python .
Sending build context to Docker daemon   2.56kB
Step 1/14 : FROM centos:7
 ---> 67fa590cfc1c
Step 2/14 : RUN yum install -y centos-release-scl  && yum install -y rh-python36
 ---> Using cache
 ---> 0ebd89c91f09
Step 3/14 : RUN /opt/rh/rh-python36/root/bin/python -m venv /py3 && /py3/bin/pip install -U pip tox future wheel restructuredtext-lint
 ---> Using cache
 ---> ebdb77daeb77
Step 4/14 : RUN /py3/bin/pip install https://github.com/ome/zeroc-ice-py-manylinux/releases/download/0.1.0/zeroc_ice-3.6.5-cp36-cp36m-manylinux2010_x86_64.whl
 ---> Using cache
 ---> 485d0d7fe97c
Step 5/14 : RUN /py3/bin/pip install scc
 ---> Using cache
 ---> 507468d7efaa
Step 6/14 : ENV VIRTUAL_ENV=/py3
 ---> Using cache
 ---> 3af88d9a3fb4
Step 7/14 : ENV PATH="$VIRTUAL_ENV/bin:$PATH"
 ---> Using cache
 ---> 6346d5ed92c4
Step 8/14 : RUN curl -sL https://rpm.nodesource.com/setup | bash
 ---> Using cache
 ---> 3cfabfd42c55
Step 9/14 : RUN yum install -y git nodejs
 ---> Using cache
 ---> c5bfb41c0eeb
Step 10/14 : RUN npm install -g grunt
 ---> Using cache
 ---> c8cfb218e8e5
Step 11/14 : RUN python -m venv /tmp/venv1
 ---> Using cache
 ---> 432482a6271c
Step 12/14 : RUN /tmp/venv1/bin/pip install git+git://github.com/snoopycrimecop/omero-figure.git@py3_ci#egg=omero-figure
 ---> Using cache
 ---> 10fbe812c714
Step 13/14 : RUN virtualenv /tmp/venv2
 ---> Using cache
 ---> 7c2446e2bf30
Step 14/14 : RUN /tmp/venv2/bin/pip install git+git://github.com/snoopycrimecop/omero-figure.git@py3_ci#egg=omero-figure
 ---> Using cache
 ---> 5eeadf96d728
Successfully built 5eeadf96d728
Successfully tagged scl_python:latest
[sbesson@idr2-slot3 venv_fun]$ docker run --rm -it scl_python
[root@3e36b933837e /]# ls /tmp/venv1/lib/python3.6/site-packages/omero_figure/static/figure/
3rdparty  css  figure.js  images  templates.js
[root@3e36b933837e /]# ls /tmp/venv2/lib/python3.6/site-packages/omero_figure/static/figure/
3rdparty  css  images
[root@3e36b933837e /]#

For omero-parade I was unsuccessful to build it the same way as webpack failed with SyntaxError: Unexpected token

will-moore commented 4 years ago

Fixed by https://github.com/ome/omero-parade/pull/71

imagesc-bot commented 4 years ago

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/omero-parade-omero-parade-is-not-a-function/38641/1