{"record":{"id":"f90aa762325f8152","repo":"Meituan-Dianping/mpvue","slug":"listeners-is-readonly","errorCode":null,"errorMessage":"$listeners is readonly.","messagePattern":"\\$listeners is readonly\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/instance/render.js","lineNumber":58,"sourceCode":"  // bind the createElement fn to this instance\n  // so that we get proper render context inside it.\n  // args order: tag, data, children, normalizationType, alwaysNormalize\n  // internal version is used by render functions compiled from templates\n  vm._c = (a, b, c, d) => createElement(vm, a, b, c, d, false)\n  // normalization is always applied for the public version, used in\n  // user-written render functions.\n  vm.$createElement = (a, b, c, d) => createElement(vm, a, b, c, d, true)\n\n  // $attrs & $listeners are exposed for easier HOC creation.\n  // they need to be reactive so that HOCs using them are always updated\n  const parentData = parentVnode && parentVnode.data\n  /* istanbul ignore else */\n  if (process.env.NODE_ENV !== 'production') {\n    defineReactive(vm, '$attrs', parentData && parentData.attrs, () => {\n      !isUpdatingChildComponent && warn(`$attrs is readonly.`, vm)\n    }, true)\n    defineReactive(vm, '$listeners', parentData && parentData.on, () => {\n      !isUpdatingChildComponent && warn(`$listeners is readonly.`, vm)\n    }, true)\n  } else {\n    defineReactive(vm, '$attrs', parentData && parentData.attrs, null, true)\n    defineReactive(vm, '$listeners', parentData && parentData.on, null, true)\n  }\n}\n\nexport function renderMixin (Vue: Class<Component>) {\n  Vue.prototype.$nextTick = function (fn: Function) {\n    return nextTick(fn, this)\n  }\n\n  Vue.prototype._render = function (): VNode {\n    const vm: Component = this\n    const {\n      render,\n      staticRenderFns,\n      _parentVnode","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/src/core/instance/render.js#L40-L76","documentation":"Comes from the dev-only setter trap installed on $listeners in initRender. $listeners is the reactive, getter-only object of parent-declared event handlers (v-on bindings) on the component, refreshed by the framework whenever the parent re-renders. Code that does this.$listeners = ... or mutates it triggers this trap; such writes are discarded because the parent vnode's data is the single source of truth for these handlers.","triggerScenarios":"Thrown at src/core/instance/render.js:58 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not assign to this.$listeners; read it (e.g. v-on=\"$listeners\" for HOC pass-through) only","To add your own handlers, declare them with $emit/$on or merge them at template level: v-on=\"{ ...$listeners, click: handleClick }\"","To modify behavior, wrap listeners in computed properties instead of mutating the object"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b","analyzedAt":"2026-09-02T05:17:40.946Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}