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 when rendering #400

Closed
StrongWeiUMN opened this issue Mar 31, 2023 · 2 comments
Closed

Javascript error when rendering #400

StrongWeiUMN opened this issue Mar 31, 2023 · 2 comments

Comments

@StrongWeiUMN
Copy link

When I run the example code, the Javascript error will raise, and cannot render the figure:

from pythreejs import *
from IPython.display import display
import ipywidgets

# Reduce repo churn for examples with embedded state:
from pythreejs._example_helper import use_example_model_ids
use_example_model_ids()

ball = Mesh(geometry=SphereGeometry(),
            material=MeshLambertMaterial(color='red'))
key_light = DirectionalLight(color='white', position=[3, 5, 1], intensity=0.5)

c = PerspectiveCamera(position=[0, 5, 5], up=[0, 1, 0], children=[key_light])

scene = Scene(children=[ball, c, AmbientLight(color='#777777')], background=None)

renderer = Renderer(camera=c,
                    scene=scene,
                    alpha=True,
                    clearOpacity=0,
                    controls=[OrbitControls(controlling=c)])
display(renderer)

The following is the raised error:

[Open Browser Console for more detailed log - Double click to close this message]
Model class 'RendererModel' from module 'jupyter-threejs' is loaded but can not be instantiated
TypeError: Cannot read properties of undefined (reading 'then')
    at http://localhost:8888/lab/extensions/jupyter-threejs/static/jupyter-threejs-chunk.ba1735fea70611ab4bc1.js?v=ba1735fea70611ab4bc1:1:32057
    at async Promise.all (index 20)
    at async f._make_model (http://localhost:8888/static/lab/4416.0944956f5de66ec0a0b0.js?v=0944956f5de66ec0a0b0:1:9684)

The following is the conda environment:

jupyter_client            8.1.0              pyhd8ed1ab_0    conda-forge
jupyter_core              5.3.0           py310h5588dad_0    conda-forge
jupyter_events            0.6.3              pyhd8ed1ab_0    conda-forge
jupyter_server            2.5.0              pyhd8ed1ab_0    conda-forge
jupyter_server_terminals  0.4.4              pyhd8ed1ab_1    conda-forge
jupyterlab                3.5.0              pyhd8ed1ab_0    conda-forge
jupyterlab_pygments       0.2.2              pyhd8ed1ab_0    conda-forge
jupyterlab_server         2.21.0             pyhd8ed1ab_0    conda-forge
jupyterlab_widgets        3.0.7              pyhd8ed1ab_0    conda-forge
pythreejs                 2.4.2              pyh1d7be83_0    conda-forge
@moorepants
Copy link

This seems to be the same as what is discussed in #389.

@StrongWeiUMN
Copy link
Author

The problem is solved by degrading the packages:
NVlabs/sionna#106

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