{"record":{"id":"980dd28e4415cfc7","repo":"Meituan-Dianping/mpvue","slug":"avoid-overwriting-built-in-modifier-in-config-keyc","errorCode":null,"errorMessage":"Avoid overwriting built-in modifier in config.keyCodes: .${key}","messagePattern":"Avoid overwriting built-in modifier in config\\.keyCodes: \\.(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/instance/proxy.js","lineNumber":34,"sourceCode":"  const warnNonPresent = (target, key) => {\n    warn(\n      `Property or method \"${key}\" is not defined on the instance but ` +\n      `referenced during render. Make sure to declare reactive data ` +\n      `properties in the data option.`,\n      target\n    )\n  }\n\n  const hasProxy =\n    typeof Proxy !== 'undefined' &&\n    Proxy.toString().match(/native code/)\n\n  if (hasProxy) {\n    const isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta')\n    config.keyCodes = new Proxy(config.keyCodes, {\n      set (target, key, value) {\n        if (isBuiltInModifier(key)) {\n          warn(`Avoid overwriting built-in modifier in config.keyCodes: .${key}`)\n          return false\n        } else {\n          target[key] = value\n          return true\n        }\n      }\n    })\n  }\n\n  const hasHandler = {\n    has (target, key) {\n      const has = key in target\n      const isAllowed = allowedGlobals(key) || key.charAt(0) === '_'\n      if (!has && !isAllowed) {\n        warnNonPresent(target, key)\n      }\n      return has || !isAllowed\n    }","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/src/core/instance/proxy.js#L16-L52","documentation":"Comes from a Proxy set trap installed over config.keyCodes in the dev build. The trap checks the assigned key against isBuiltInModifier ('stop,prevent,self,ctrl,shift,alt,meta'); assigning any of those names to config.keyCodes triggers this warning because they collide with v-on/v-bind built-in event modifier names and would break modifier parsing in compiled templates. The assignment itself is otherwise permitted.","triggerScenarios":"Thrown at src/core/instance/proxy.js:34 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a keyCode alias that is not one of the built-in modifier names (stop, prevent, self, ctrl, shift, alt, meta)","If you intended to customize a modifier's behavior, that is not supported — pick a new alias name for your custom key combination"],"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"}