{"record":{"id":"50d9fdcd80a38051","repo":"Meituan-Dianping/mpvue","slug":"passive-and-prevent-can-t-be-used-together-passiv-50d9fd","errorCode":null,"errorMessage":"passive and prevent can't be used together. Passive handler can't prevent default event.","messagePattern":"passive and prevent can't be used together\\. Passive handler can't prevent default event\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/compiler/helpers.js","lineNumber":51,"sourceCode":") {\n  (el.directives || (el.directives = [])).push({ name, rawName, value, arg, modifiers })\n}\n\nexport function addHandler (\n  el: ASTElement,\n  name: string,\n  value: string,\n  modifiers: ?ASTModifiers,\n  important?: boolean,\n  warn?: Function\n) {\n  // warn prevent and passive modifier\n  /* istanbul ignore if */\n  if (\n    process.env.NODE_ENV !== 'production' && warn &&\n    modifiers && modifiers.prevent && modifiers.passive\n  ) {\n    warn(\n      'passive and prevent can\\'t be used together. ' +\n      'Passive handler can\\'t prevent default event.'\n    )\n  }\n  // check capture modifier\n  if (modifiers && modifiers.capture) {\n    delete modifiers.capture\n    name = '!' + name // mark the event as captured\n  }\n  if (modifiers && modifiers.once) {\n    delete modifiers.once\n    name = '~' + name // mark the event as once\n  }\n  /* istanbul ignore if */\n  if (modifiers && modifiers.passive) {\n    delete modifiers.passive\n    name = '&' + name // mark the event as passive\n  }","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/src/compiler/helpers.js#L33-L69","documentation":"Dev-only warning in addHandler during codegen: an event was declared with both .prevent and .passive modifiers. Passive listeners promise the browser they will never call preventDefault (enabling scroll optimization), so the generated preventDefault guard would be ignored/contradictory; the combination is always a mistake.","triggerScenarios":"Thrown at src/compiler/helpers.js:51 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Drop .passive if you actually need to preventDefault","Drop .prevent if the handler truly never prevents default (e.g. scroll-optimized listeners)"],"exampleFix":null,"handlingStrategy":"validation","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"}