Element: [Bug, Report], Uncaught, TypeError:, Cannot, read, property,'prototype', undefined, of

Created on 2 Jul 2017  ·  11Comments  ·  Source: ElemeFE/element

Element UI version

1.3.7

OS/Browsers version

windows7/google chrome 59.0.3071.115(正式版本) (32 位)

Vue version

2.3.4

Reproduction Link

https://codepen.io/Quieterwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww/pen/awYqgN

Steps to reproduce

页面中引入index.js,其他什么都不需要做,就会报错

What is Expected?

不报错

What is actually happening?

报错:Uncaught TypeError: Cannot read property 'prototype' of undefined

Most helpful comment

不是版本问题,应该是引入顺序错了,把vue.js引用放在index.js前面就好了

All 11 comments

Translation of this issue:

Element UI version

1.3.7

OS/Browsers version

Windows7/google chrome 59.0.3071.115 (official version) (32 bits)

Vue version

2.3.4

Reproduction Link

https://codepen.io/Quieterwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww/pen/awYqgN

Steps to reproduce

Index.js is introduced into the page, and nothing else needs to be done

What is Expected?

Error free

What is actually happening?

Error: Uncaught, TypeError:, Cannot, read, property,'prototype', of, undefined

找到原因了,自己的问题

什么原因,我也遇到类似的问题,vue-cli新建的项目刚引入element报错:

index.js:2 Uncaught TypeError: Cannot read property 'prototype' of undefined
at Object.t.__esModule (index.js:2)
at t (index.js:1)
at Object.t.__esModule (index.js:2)
at t (index.js:1)
at Object.t.__esModule (index.js:2)
at t (index.js:1)
at Object.t.__esModule (index.js:2)
at t (index.js:1)
at Object.t.__esModule (index.js:2)
at t (index.js:1)

I have the same issue.
Vue 2.8.2
Element-ui 1.4.3

Uncaught TypeError: Cannot read property 'prototype' of undefined
at Object.t.__esModule (index.js:2)
at t (index.js:1)
at Object.t.__esModule (index.js:2)
at t (index.js:1)
at Object.t.__esModule (index.js:2)
at t (index.js:1)
at Object.t.__esModule (index.js:2)
at t (index.js:1)
at Object.t.__esModule (index.js:2)
at t (index.js:1)

property 'prototype' of undefined 为啥黎?

卧槽 ,什么原因 ,说一下啊大哥 。 我在vue中的 index.html刚刚引入 就报错

@dinghao1994 看看是不是引入的vue版本不对

版本是 2.9.3 应该不是版本问题吧

不是版本问题,应该是引入顺序错了,把vue.js引用放在index.js前面就好了

vuejs的文件引入需要在element-ui的index.js文件前面

正如 @JesseJia@gdmec07140726 说的,引入顺序问题。我是 rails 写了嵌套模版,里层引入 element-ui,外层引入 vue,但是渲染顺序写反了

<head>
  <%= stylesheet_link_tag    'v2/element-ui', media: 'all' %>
  <%= javascript_include_tag 'v2/element-ui' %>
</head>

<%= render template: "layouts/v2/application" %> <%#引入 vue%>

顺序调整一下就好了

<%= render template: "layouts/v2/application" %> <%#引入 vue%>

<head>
  <%= stylesheet_link_tag    'v2/element-ui', media: 'all' %>
  <%= javascript_include_tag 'v2/element-ui' %>
</head>
Was this page helpful?
0 / 5 - 0 ratings