import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-default/index.css'
import App from './App.vue'
Vue.use(ElementUI)
new Vue({
el: '#app',
render: h => h(App)
})
error:
Uncaught TypeError: Cannot read property 'prototype' of undefined
at Object.e.__esModule.default (index.js:2)
at t (index.js:1)
at Object.e.__esModule.default (index.js:2)
at t (index.js:1)
at Object.e.__esModule.default (index.js:2)
at t (index.js:1)
at Object.e.__esModule.default (index.js:2)
at t (index.js:1)
at Object.e.__esModule.default (index.js:2)
at t (index.js:1)
"dependencies": {
"element-ui": "^1.2.3",
"vue": "^2.1.10"
}
I had the same problem. After I removed the <script src="https://unpkg.com/element-ui/lib/index.js"></script>
in the index.html
, the error is gone. Hope that helps.
Hi! I had the same problem, how to fix this?
To fix this issue just import your javascript file for element UI after importing VueJS
But in the index file there is no inclusion of the VueJs
so if you put <script src="https://unpkg.com/element-ui/lib/index.js"></script>
after 'built files will be auto injected' you will get the error. So i don't know how to solve this.
Most helpful comment
I had the same problem. After I removed the
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
in theindex.html
, the error is gone. Hope that helps.