HelloZeroNet/ZeroNet · error · Error

Provide a transitions object to the projectionOptions to do

Error message

Provide a transitions object to the projectionOptions to do animations

What it means

Identical to error 0: in the standalone maquette library bundle, missingTransition is the default placeholder for animations in projectionOptions. When a vnode's enterAnimation/exitAnimation fires during DOM creation or removal and no transitions object was provided, this stub throws.

Source

Thrown at plugins/UiConfig/media/js/lib/maquette.js:74

    };
    var appendChildren = function (parentSelector, insertions, main) {
        for (var i = 0; i < insertions.length; i++) {
            var item = insertions[i];
            if (Array.isArray(item)) {
                appendChildren(parentSelector, item, main);
            } else {
                if (item !== null && item !== undefined) {
                    if (!item.hasOwnProperty('vnodeSelector')) {
                        item = toTextVNode(item);
                    }
                    main.push(item);
                }
            }
        }
    };
    // Render helper functions
    var missingTransition = function () {
        throw new Error('Provide a transitions object to the projectionOptions to do animations');
    };
    var DEFAULT_PROJECTION_OPTIONS = {
        namespace: undefined,
        eventHandlerInterceptor: undefined,
        styleApplyer: function (domNode, styleName, value) {
            // Provides a hook to add vendor prefixes for browsers that still need it.
            domNode.style[styleName] = value;
        },
        transitions: {
            enter: missingTransition,
            exit: missingTransition
        }
    };
    var applyDefaultProjectionOptions = function (projectorOptions) {
        return extend(DEFAULT_PROJECTION_OPTIONS, projectorOptions);
    };
    var checkStyleValue = function (styleValue) {
        if (typeof styleValue !== 'string') {

View on GitHub (pinned to 454c0b2e7e)

Solutions

  1. Pass transitions: maquette.createCSSTransitionsAnimationHelper() in the projectionOptions used for append/merge/createDom.
  2. Remove enterAnimation/exitAnimation properties if animations are not wanted.
  3. Register the transitions object globally via maquette.setProjectionOptions({ transitions: ... }) before rendering.

Example fix

// before
maquette.dom.append(el, h('div', { exitAnimation: 'fadeOut' }, []));
// after
var opts = { transitions: maquette.createCSSTransitionsAnimationHelper() };
maquette.dom.append(el, h('div', { exitAnimation: 'fadeOut' }, []), opts);
Defensive patterns

Strategy: validation

Validate before calling

function assertTransitions(projectionOptions) {
  if (projectionOptions && !projectionOptions.transitions) {
    throw new Error('projectionOptions.transitions is required when using enter/exit animations');
  }
}
// call before dom.append/merge/createDom on the standalone maquette bundle

Type guard

function hasTransitions(opts) {
  return typeof opts === 'object' && opts !== null && typeof opts.transitions === 'object' && opts.transitions !== null;
}

Try / catch

try {
  projection = maquette.dom.append(el, vnode, projectionOptions);
} catch (e) {
  if (e.message.indexOf('transitions object') !== -1) {
    projectionOptions.transitions = maquette.createCSSTransitionsAnimationHelper();
    projection = maquette.dom.append(el, vnode, projectionOptions);
  } else { throw e; }
}

Prevention

When it happens

Trigger: Rendering or updating vnodes carrying enterAnimation/exitAnimation (or transition helpers) via dom.append/merge/createDom or projector.append without passing { transitions: ... } in projectionOptions.

Common situations: Using CSS-transition animations from maquette examples but omitting the transitions helper from projectionOptions; building projectionOptions ad hoc in one call site while animations were added elsewhere.

Related errors


AI-assisted analysis of HelloZeroNet/ZeroNet@454c0b2e7e (2026-09-02). Data as JSON: /api/errors/27197aaa0aaa7aa9. Report an issue: GitHub.