{"record":{"id":"470d85dbf3ae33f2","repo":"Meituan-Dianping/mpvue","slug":"vue-is-a-constructor-and-should-be-called-with-the","errorCode":null,"errorMessage":"Vue is a constructor and should be called with the `new` keyword","messagePattern":"Vue is a constructor and should be called with the `new` keyword","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/instance/index.js","lineNumber":12,"sourceCode":"import { initMixin } from './init'\nimport { stateMixin } from './state'\nimport { renderMixin } from './render'\nimport { eventsMixin } from './events'\nimport { lifecycleMixin } from './lifecycle'\nimport { warn } from '../util/index'\n\nfunction Vue (options) {\n  if (process.env.NODE_ENV !== 'production' &&\n    !(this instanceof Vue)\n  ) {\n    warn('Vue is a constructor and should be called with the `new` keyword')\n  }\n  this._init(options)\n}\n\ninitMixin(Vue)\nstateMixin(Vue)\neventsMixin(Vue)\nlifecycleMixin(Vue)\nrenderMixin(Vue)\n\nexport default Vue\n","sourceCodeStart":1,"sourceCodeEnd":24,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/src/core/instance/index.js#L1-L24","documentation":"Emitted from the Vue constructor function itself when it is invoked without 'new' (the 'this instanceof Vue' check fails) in non-production builds. Calling Vue() as a plain function leaves 'this' undefined/global, so the immediately following this._init(options) call would throw a more confusing TypeError; this dev-only guard catches the mistake early. Note the constructor still proceeds and will crash right after the warning.","triggerScenarios":"Thrown at src/core/instance/index.js:12 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Instantiate with new: const app = new Vue({...})","For component code paths use Vue.extend or registration options instead of calling Vue directly","Check for calls like Vue(options) or Vue().mount('#app') in your bootstrap code"],"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"}