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

Exported HTML does not render in browser since last week #3754

Closed
dimentary opened this issue Apr 6, 2023 · 1 comment
Closed

Exported HTML does not render in browser since last week #3754

dimentary opened this issue Apr 6, 2023 · 1 comment
Labels
answered The issue has been answered by a community member. closing as answered The issue will be closed as answered soon unless there is further follow-up.

Comments

@dimentary
Copy link

dimentary commented Apr 6, 2023

Description

Up until recently I was successfully exporting 3D visualizations into HTML files with pyvista (that relies on ipywidgets for that) and opening them in the browser. A week or two ago all my exported HTMLs started showing blank pages with nothing rendered, this is the same for old HTMLs that were opening correctly before.

I've tried opening it on 3 different computers with Edge, Chrome, and Firefox - the same situation. Asked my teammates to reproduce and they confirm that the issue is also started happening to them.

I suspect this may be related to #3735 because of a similar error in the browser console:
embed-amd.js:16 DOMException: Failed to execute 'structuredClone' on 'Window': #<Promise> could not be cloned.

Browser Console Image

image

If I manually change the HTML file code to load 0.19.0 of @jupyter-widgets/html-manager instead of 0.20.0 (or any later version) everything works as expected and browser renders a 3D scene. But it was working fine with 0.20.0 in the past

Reproduce

import pyvista as pv

plotter = pv.Plotter()
sphere = pv.Sphere()  # Add something to fill the scene
plotter.add_mesh(sphere, color=color)
plotter.export_html(output_file_directory)
plotter.close()
  1. Open generated HTML file in browser
  2. Check console for javascript errors

Expected behavior

Browser showing the interactive 3D scene instead of an empty page.

Context

  • ipywidgets version: 8.0.4
  • Operating System and version: Ubuntu 22.04
  • Browser and version: Microsoft Edge Version 111.0.1661.62
Browser Output
embed-amd.js:20 
   strict mode: use allowUnionTypes to allow union type keyword at "#/properties/state/additionalProperties/properties/buffers/items/properties/path/items" (strictTypes)

b @ embed-amd.js:20
embed-amd.js:10

   strict mode: use allowUnionTypes to allow union type keyword at "#/properties/state/additionalProperties/properties/buffers/items/properties/path/items" (strictTypes)

p @ embed-amd.js:10
jupyter-threejs.js:1

   Failed to load resource: net::ERR_FILE_NOT_FOUND

35embed-amd.js:26 Falling back to https://cdn.jsdelivr.net/npm/ for jupyter-threejs@^2.4.1
5embed-amd.js:2

   Error serializing widget state attribute:  camera

serialize @ embed-amd.js:2
embed-amd.js:16

   DOMException: Failed to execute 'structuredClone' on 'Window': #<Promise> could not be cloned.
at s.serialize (https://cdn.jsdelivr.net/npm/@jupyter-widgets/html-manager@%5E1.0.1/dist/embed-amd.js:2:397419)
at s.<anonymous> (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:841610)
at s.c (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:78248)
at O._settlePromiseFromHandler (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:51172)
at O._settlePromise (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:51972)
at O._settlePromise0 (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:52671)
at O._settlePromises (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:54023)
at O._fulfill (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:53041)
at O._resolveCallback (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:49916)
at O._settlePromiseFromHandler (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:51326)
at O._settlePromise (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:51972)
at O._settlePromise0 (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:52671)
at O._settlePromises (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:54023)
at O._fulfill (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:53041)
at s._resolve (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:57638)
at s._promiseFulfilled (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:57979)

From previous event:
at O.I [as _captureStackTrace] (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:20361)
at O._then (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:46571)
at O.then (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:44927)
at l.initialize (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:824622)
at new t.Model (https://cdn.jsdelivr.net/npm/@jupyter-widgets/html-manager@%5E1.0.1/dist/embed-amd.js:2:6798)
at new l (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:1030236)
at rl._make_model (https://cdn.jsdelivr.net/npm/@jupyter-widgets/html-manager@%5E1.0.1/dist/embed-amd.js:16:325917)
_make_model @ embed-amd.js:16
embed-amd.js:16

   TypeError: Cannot read properties of undefined (reading 'then')
at index.js:2:839737
at async Promise.all (index 4)
at async rl._make_model (embed-amd.js:16:325880)

_make_model @ embed-amd.js:16
embed-amd.js:16

   TypeError: Cannot read properties of undefined (reading 'then')
at index.js:2:839737
at async Promise.all (index 0)
at async rl._make_model (embed-amd.js:16:325880)

_make_model @ embed-amd.js:16
embed-amd.js:16

   TypeError: Cannot read properties of undefined (reading 'then')
at https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:839737

From previous event:
at O.I [as _captureStackTrace] (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:20361)
at https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:73512
at https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:73749
at s._iterate (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:57154)
at s.e [as _init] (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:56680)
at new s (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:56149)
at O.all (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:46014)
at Object.e [as deserialize] (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:839521)
at l._deserialize_state (https://cdn.jsdelivr.net/npm/@jupyter-widgets/html-manager@%5E1.0.1/dist/embed-amd.js:2:398461)
at rl._make_model (https://cdn.jsdelivr.net/npm/@jupyter-widgets/html-manager@%5E1.0.1/dist/embed-amd.js:16:325888)
_make_model @ embed-amd.js:16
5index.js:2

   Unhandled rejection DataCloneError: Failed to execute 'structuredClone' on 'Window': #<Promise> could not be cloned.    at s.serialize (https://cdn.jsdelivr.net/npm/@jupyter-widgets/html-manager@%5E1.0.1/dist/embed-amd.js:2:397419)    at s.<anonymous> (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:841610)    at s.c (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:78248)    at O._settlePromiseFromHandler (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:51172)    at O._settlePromise (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:51972)    at O._settlePromise0 (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:52671)    at O._settlePromises (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:54023)    at O._fulfill (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:53041)    at O._resolveCallback (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:49916)    at O._settlePromiseFromHandler (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:51326)    at O._settlePromise (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:51972)    at O._settlePromise0 (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:52671)    at O._settlePromises (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:54023)    at O._fulfill (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:53041)    at s._resolve (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:57638)    at s._promiseFulfilled (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:57979)From previous event:    at O.I [as _captureStackTrace] (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:20361)    at O._then (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:46571)    at O.then (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:44927)    at l.initialize (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:824622)    at new t.Model (https://cdn.jsdelivr.net/npm/@jupyter-widgets/html-manager@%5E1.0.1/dist/embed-amd.js:2:6798)    at new l (https://cdn.jsdelivr.net/npm/jupyter-threejs@%5E2.4.1/dist/index.js:2:1030236)    at rl._make_model (https://cdn.jsdelivr.net/npm/@jupyter-widgets/html-manager@%5E1.0.1/dist/embed-amd.js:16:325917)

s @ index.js:2

@dimentary dimentary changed the title Exported HTML does not render in browser after updates Exported HTML does not render in browser since last week Apr 6, 2023
@ibdafna
Copy link
Member

ibdafna commented Apr 10, 2023

Version 8.0.6 has been released, which should include a fix for the this issue. Please update your package. Thanks!

@ibdafna ibdafna added the answered The issue has been answered by a community member. label Apr 10, 2023
@github-actions github-actions bot added the closing as answered The issue will be closed as answered soon unless there is further follow-up. label May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered The issue has been answered by a community member. closing as answered The issue will be closed as answered soon unless there is further follow-up.
Projects
None yet
Development

No branches or pull requests

2 participants