fernandogmar / Emberjs-RequireJS

Starter kit for EmberJS using RequireJS
79 stars 23 forks source link

Upgrade to v1.0.0-pre.3 - Application initialize may only be called once #2

Closed jessecravens closed 11 years ago

jessecravens commented 11 years ago

When upgrading to v1.0.0-pre.3, I get the following errors:

Uncaught Error: assertion failed: Ember.Object.create no longer supports defining methods that call _super.

Which it appears that for performance reasons, the original create() functionality was preserved in createWithMixins()

Which is answered fairly clearly here:

https://github.com/emberjs/ember.js/commit/c1c720781c976f69fd4014ea50a1fee652286048

https://github.com/emberjs/ember.js/pull/1623#issuecomment-11699639

http://stackoverflow.com/questions/13856755/ember-application-create-with-mixin-and-parameters

But once I make that change, I now get this error:

Uncaught Error: assertion failed: Application initialize may only be called once  

A search of your codebase and only running an App.initialize() once.

(function(root){
  require(["config"], function(config){
    requirejs.config(config);
    require(["App", "domReady!", "ember"], function(App, doc, Ember){
        var app_name = config.app_name || "App";
        root[app_name] = App = Ember.Application.create(App);
        !App.isInitialized && App.initialize();
    });
  });
 })(this); 

Any Ideas?

jessecravens commented 11 years ago

Arg .. no more initialize()

fernandogmar commented 11 years ago

Hi Jesse,

sorry if I'm late. After your comment I have been trying to upgrade the starter-kit and the example, working around the new version of ember.pre4 and the new router :(... a bit hard but I got it.

You have here available a first working try.

Any suggestions will be welcome.

Have fun! ;)