Meituan-Dianping/mpvue · warning

v-bind without argument expects an Object or Array value

Error message

v-bind without argument expects an Object or Array value

What it means

`bindObjectProps` handles `v-bind` with no explicit argument (i.e. `v-bind="value"`), which spreads an object (or array of objects) of props/attrs onto the element. If the bound value is truthy but not an object, Vue warns because there is nothing sensible to spread.

Source

Thrown at packages/weex-vue-framework/factory.js:3909

    return keyCodes !== eventKeyCode
  }
}

/*  */

/**
 * Runtime helper for merging v-bind="object" into a VNode's data.
 */
function bindObjectProps (
  data,
  tag,
  value,
  asProp,
  isSync
) {
  if (value) {
    if (!isObject(value)) {
      process.env.NODE_ENV !== 'production' && warn(
        'v-bind without argument expects an Object or Array value',
        this
      );
    } else {
      if (Array.isArray(value)) {
        value = toObject(value);
      }
      var hash;
      var loop = function ( key ) {
        if (
          key === 'class' ||
          key === 'style' ||
          isReservedAttribute(key)
        ) {
          hash = data;
        } else {
          var type = data.attrs && data.attrs.type;
          hash = asProp || config.mustUseProp(tag, type, key)

View on GitHub (pinned to 6c5d78ee04)

Solutions

  1. Bind an object: `<div v-bind="{ id: x, class: y }">` or `<div v-bind="propsBag">`.
  2. Fix the computed/data source to return an object (or array of objects).
  3. Guard the binding: `v-bind="isObj ? propsBag : {}"`.
  4. If you meant a single attribute, restore the argument: `v-bind:id="value"`.

Example fix

// before
<div v-bind="'id=foo'" />
// after
<div v-bind="{ id: 'foo' }" />
Defensive patterns

Strategy: type-guard

Validate before calling

if (boundValue != null && typeof boundValue !== 'object') {
  throw new TypeError('v-bind without argument requires an Object or Array');
}

Type guard

function isBindableObject(v) {
  return v != null && typeof v === 'object' && !Array.isArray(v) ? true : Array.isArray(v);
}

Prevention

When it happens

Trigger: `<div v-bind="someString">`, `v-bind="42"`, `v-bind="computedValue"` where the computed returns a primitive instead of an object/array; template refactors that dropped the argument (`v-bind:x="obj"` became `v-bind="obj"` accidentally).

Common situations: Passing prop-spread objects from a parent as a string via an attribute; computed properties whose return type changed after a refactor; conditional spreads like `v-bind="cond && extraProps"` where `cond` is a truthy non-object.

Related errors


AI-assisted analysis of Meituan-Dianping/mpvue@6c5d78ee04 (2026-09-02). Data as JSON: /api/errors/29c9971fe3b7f863. Report an issue: GitHub.