{"record":{"id":"aa741137bdd68526","repo":"Meituan-Dianping/mpvue","slug":"option-key-can-only-be-used-during-instance-c","errorCode":null,"errorMessage":"option \"${key}\" can only be used during instance creation with the `new` keyword.","messagePattern":"option \"(.+?)\" can only be used during instance creation with the `new` keyword\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/util/options.js","lineNumber":35,"sourceCode":"  capitalize,\n  isBuiltInTag,\n  isPlainObject\n} from 'shared/util'\n\n/**\n * Option overwriting strategies are functions that handle\n * how to merge a parent option value and a child option\n * value into the final value.\n */\nconst strats = config.optionMergeStrategies\n\n/**\n * Options with restrictions\n */\nif (process.env.NODE_ENV !== 'production') {\n  strats.el = strats.propsData = function (parent, child, vm, key) {\n    if (!vm) {\n      warn(\n        `option \"${key}\" can only be used during instance ` +\n        'creation with the `new` keyword.'\n      )\n    }\n    return defaultStrat(parent, child)\n  }\n}\n\n/**\n * Helper that recursively merges two data objects together.\n */\nfunction mergeData (to: Object, from: ?Object): Object {\n  if (!from) return to\n  let key, toVal, fromVal\n  const keys = Object.keys(from)\n  for (let i = 0; i < keys.length; i++) {\n    key = keys[i]\n    toVal = to[key]","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/src/core/util/options.js#L17-L53","documentation":"Comes from the el/propsData option merge strategies in dev mode. These strategies receive the vm argument during mergeOptions; when vm is absent the merge is happening for a component definition (Vue.extend / component registration) rather than instance creation, and el/propsData are per-instance options that only make sense with 'new Vue(...)'. Declaring them on a component definition triggers this warning; the value is then merged with the default strategy but is ignored when the definition is used as a component.","triggerScenarios":"Thrown at src/core/util/options.js:35 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove el/propsData from the component definition; pass them at instantiation: new Vue({ el: '#app', propsData })","Supply mount targets via the $mount API or the el on the root instance only","For props in tests, pass them through the mounting utility (e.g. propsData in vue-test-utils mount options) rather than the component options"],"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"}