The error code is as follows:
app.js:160 Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')
at eval (types.js?8ad0:39:1)
at ./node_modules/element-ui/lib/utils/types.js (chunk-vendors.js:834:1)
at __webpack_require__ (app.js:157:33)
at fn (app.js:402:21)
at eval (util.js?40a4:19:1)
at ./node_modules/element-ui/lib/utils/util.js (chunk-vendors.js:845:1)
at __webpack_require__ (app.js:157:33)
at fn (app.js:402:21)
at eval (format.js?5a92:49:1)
at ./node_modules/element-ui/lib/locale/format.js (chunk-vendors.js:501:1)
Reason for error:
Because I created a VUE3 project, the version of VUE is 3.2.13, and element-ui is only applicable to VUE2 projects. After my inquiry, element-plus is applicable to VUE3 projects. In order to prove this problem more fully, I created a VUE2 project with version 2.6.14, which can reference element-ui.
solution
1. First confirm whether your project is a VUE2 project or a VUE3 project, and check it in the package.json file, as shown in the figure below.
2. According to the VUE version, perform one of the following steps
A. If it is a VUE2 project, install element-ui, the instructions are as follows
npm i element-ui --save
B. If it is a VUE3 project, install element-plus, the command is as follows
npm i element-plus --save
Summarize
The Vue2 project installs element-ui, and the VUE3 project installs element-plus.