Diorama

Made for a big screen.

This site is one 3D scene, built for a computer: a wide window and a mouse. Open dioramajs.dev on a desktop or a laptop to see it.This site is one 3D scene, built for a wide window. Make this one wider, or open dioramajs.dev on a larger screen.

GitHub

DioramaDocs

EFFECT_UPDATE

Package @dioramajs/diorama/effects Level error

The update function of an effect threw during a frame, so that instance failed at once.

View as Markdown
On this page
EFFECT_UPDATE: {message}

The message is the message of the error the update function threw, and that error is the cause.

Why it happens

  • The function that setup returned throws. The instance fails on the first throw: a broken frame is visible, so effects do not wait for the 10 failures after which the kernel disables a system. Other instances keep updating, each in its own try.
  • The update writes to the DOM of an element that left the page. During a page transition ctx.element of a leaving copy is a detached node, and its update keeps running while the copy flies or fades.

When the update of a leaving copy throws, only that copy is released. In development this prints as an EFFECT_TARGET warning that starts with a ghost failed and was released.

How to fix

  1. Expand the reported error in the console and read the stack of the cause.
  2. Keep DOM reads and writes out of update. Read layout through ctx.input and the inputs on ctx.u, which Diorama measures for you.
  3. Start the instance again after the fix: remove its token from data-dio and add it back, or reload. In development, HMR replaces the definition and the instance retries.