-
Notifications
You must be signed in to change notification settings - Fork 122
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
JavascriptException: Message: javascript error: k3dRefresh is not defined #354
Comments
Hi @basilevh, thank you for your feedback. I ran the However I already had this error message several time while working with Most of the time, rebooting my laptop solve the issue for me. |
I'm battling with the same problem. With trials and errors I understood that:
Now to the funny behavior: let's say I'm trying to generate some screenshots in headless mode with Chrome. The first time executing a script always works fine. From the second time, the above errors start displaying at random. Now, If I change the browser to headless Firefox everything works fine. Then, If I switch back to headless Chrome, again the first time always works fine. From the second time the above errors start displaying at random... It's weird, it's like Chrome stores some memory from different sessions. I've tried resetting the cache between executions, both it doesn't help. Also note that that options like |
I was having the same issue on MacOS when running the headless.ipynb notebook in VSCode. Since my main browser is Firefox I decided to see if using Firefox instead of Chrome would help. I edited k3d/headless.py in my site-package to add this new function: def get_headless_firefox_driver(no_headless=False):
from selenium import webdriver
from selenium.webdriver.firefox.service import Service as FirefoxService
from webdriver_manager.firefox import GeckoDriverManager
options = webdriver.FirefoxOptions()
options.add_argument("--no-sandbox")
if not no_headless:
options.add_argument("--headless")
return webdriver.Firefox(service=FirefoxService(GeckoDriverManager().install()),
options=options) and then replaced the import and call to In an ideal world |
Thanks @dazzag24 ! |
Hi! Please check https://pypi.org/project/k3d/2.16.1/ :) |
I can reproduce the Firefox problem with jupyter on docker and readthedocs (ie Ubuntu), with the same behavior. |
Hi, I did experience a similar error in my application. I run a custom ML model on a SLURM cluster and wanted to render the output with k3d and save the image to tensorboard logger. I used the
|
When I try to run https://github.com/K3D-tools/K3D-jupyter/blob/main/examples/headless.ipynb via Jupyter notebook on a remote Ubuntu 20.04.4 LTS machine with Python 3.7.13 and k3d 2.14.1 installed, calling
headless.sync()
triggers the following rather hard to interpret error:Any help is appreciated. Thanks!
The text was updated successfully, but these errors were encountered: