Take the 2-minute tour ×

I'm starting on learning EmberJS and I see this error in the console :

Uncaught TypeError: Cannot call method 'proto' of undefined ember-1.0.pre.min.js:17

It seems that just by including the library I get that error. Does anyone have any idea why I get that ?

EDIT : Added HTML Markup

<!doctype html>

  <html lang="en">
    <meta charset="UTF-8">

    <meta name="description" content="">
    <meta name="author" content="">



    <!--[if lt IE 9]>
    <script type="text/x-handlebars">
      {{#view App.MyView}}
        <h1>Hello world!</h1>

  <script src="js/libs/ember-1.0.pre.js"></script>

Also there's this JS in the app.js file :

var App = Em.Application.create();

App.MyView = Em.View.extend({
  mouseDown: function() {
  window.alert("hello world!");

but it has been removed and all the templating part from the HTML as well, and I still got the same error (:

share|improve this question
Very difficult to say what is going on without more context... –  sly7_7 Oct 23 '12 at 20:44
@sly7_7 - that's the thing ... there's nothing else going one, just an simple index.html file in which the jquery and handlebars libs are included (: –  rolandjitsu Oct 23 '12 at 20:46
Could you try with the non minified version and see what is undefined ? –  sly7_7 Oct 23 '12 at 20:48
Ok, you have to declare the App as a global (removing var). –  sly7_7 Oct 23 '12 at 21:10
I think handlebars try to get the "context" from global. but the only global variable you should have, is the App namespace itself. After that all should be define from this namespace. –  sly7_7 Oct 23 '12 at 21:14
show 4 more comments

1 Answer

up vote 1 down vote accepted

From the Ember Documentation:

Every Ember app should have an instance of Ember.Application. This object will serve as the globally-accessible namespace for all of the other classes and instances in your app

The key here is "global". Here's an example of an application:

window.App = Ember.Application.create();

Your problem is the var-keyword on your Application.create. Remove that and add Window to make the error disappear.

share|improve this answer
add comment

Your Answer


