{"record":{"id":"54c28c7b0ea3f632","repo":"Meituan-Dianping/mpvue","slug":"property-or-method-key-is-not-defined-on-the","errorCode":null,"errorMessage":"Property or method \"${key}\" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.","messagePattern":"Property or method \"(.+?)\" is not defined on the instance but referenced during render\\. Make sure to declare reactive data properties in the data option\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/instance/proxy.js","lineNumber":17,"sourceCode":"/* not type checking this file because flow doesn't play well with Proxy */\n\nimport config from 'core/config'\nimport { warn, makeMap } from '../util/index'\n\nlet initProxy\n\nif (process.env.NODE_ENV !== 'production') {\n  const allowedGlobals = makeMap(\n    'Infinity,undefined,NaN,isFinite,isNaN,' +\n    'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +\n    'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +\n    'require' // for Webpack/Browserify\n  )\n\n  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","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/src/core/instance/proxy.js#L1-L35","documentation":"Emitted by warnNonPresent, the handler behind the dev-only initProxy Proxy that wraps component instances (_renderProxy). During rendering, a 'has' or 'get' trap on the proxy intercepted a property access (key) that exists neither on the instance nor in the allowedGlobals whitelist (Infinity, Math, Date, require, etc.). The render function references something Vue never defined — usually an undeclared data property, a misspelled property, or a global like a browser API used directly in the template.","triggerScenarios":"Thrown at src/core/instance/proxy.js:17 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Declare the property in data() with an initial value so it is reactive and proxied on the instance","If it derives from other state, make it a computed property instead","For non-reactive constants used in templates, reference them via a computed or a method — plain globals and undeclared variables are blocked by the proxy whitelist","Check spelling/case of the property name in the template versus the script"],"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"}