Meituan-Dianping/mpvue · warning
v-on without argument expects an Object value
Error message
v-on without argument expects an Object value
What it means
`bindObjectListeners` implements `v-on="value"` without an argument, which merges a plain object of `{ eventName: handler }` into the vnode's `on` data. If the value is truthy but not a plain object, Vue warns because listeners cannot be derived from it.
Source
Thrown at packages/weex-vue-framework/factory.js:4013
}
}
} else {
markStaticNode(tree, key, isOnce);
}
}
function markStaticNode (node, key, isOnce) {
node.isStatic = true;
node.key = key;
node.isOnce = isOnce;
}
/* */
function bindObjectListeners (data, value) {
if (value) {
if (!isPlainObject(value)) {
process.env.NODE_ENV !== 'production' && warn(
'v-on without argument expects an Object value',
this
);
} else {
var on = data.on = data.on ? extend({}, data.on) : {};
for (var key in value) {
var existing = on[key];
var ours = value[key];
on[key] = existing ? [].concat(ours, existing) : ours;
}
}
}
return data
}
/* */
function initRender (vm) {View on GitHub (pinned to 6c5d78ee04)
Solutions
- Bind a plain object of handlers: `v-on="{ click: onClick, input: onInput }"`.
- Convert to a plain object: `v-on="{ ...listenerMap }"` or build it in a computed returning a fresh `{}`.
- If a single handler was intended, restore the argument: `v-on:click="fn"`.
- Guard: `v-on="isPlainObj(h) ? h : {}"`.
Example fix
// before
<div v-on="handleClick" />
// after
<div v-on="{ click: handleClick }" /> Defensive patterns
Strategy: type-guard
Validate before calling
if (listeners != null && (typeof listeners !== 'object' || Array.isArray(listeners) || listeners.constructor !== Object)) {
throw new TypeError('v-on without argument requires a plain object of handlers');
} Type guard
function isListenerMap(v) {
return v != null && typeof v === 'object' && !Array.isArray(v) && Object.getPrototypeOf(v) === Object.prototype;
} Prevention
- Always pass plain `{ event: handler }` objects to argless v-on.
- Unwrap observed store objects: `v-on="{ ...map }"`.
- Type the prop/computed feeding v-on as `Record<string, Function>`.
When it happens
Trigger: `<div v-on="someArray">` or `v-on="handlerFn"` (a function, not an object of handlers); passing a reactive/non-plain object (e.g. a class instance or observed object) to `v-on`; `v-on="cond && handlers"` where the truthy branch isn't a plain object.
Common situations: Migrating from `v-on:click="fn"` by deleting the argument; spreading listener maps stored in Vuex (observed objects); passing class-instance event maps from TypeScript code.
Related errors
- Use "contextmenu" instead of "click.right" since right click
- v-bind without argument expects an Object or Array value
- tag <${tag}> has no matching end tag.
- passive and prevent can't be used together. Passive handler
- Templates should only be responsible for mapping the state t
AI-assisted analysis of Meituan-Dianping/mpvue@6c5d78ee04 (2026-09-02).
Data as JSON: /api/errors/d7c1a1805518703b.
Report an issue: GitHub.