Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha Premium Member
    Join Date
    Oct 2011
    Location
    Paris, France
    Posts
    187
    Vote Rating
    3
    olouvignes is on a distinguished road

      0  

    Default Basic app broken in PR4 "Replacing a layout after one has already been initialized...

    Basic app broken in PR4 "Replacing a layout after one has already been initialized...


    All my apps crashed with PR4.

    I'm getting "Uncaught Error: [ERROR][Ext.Container#setLayout] Replacing a layout after one has already been initialized is not currently supported." everywhere.

    Any known workaround?

    You should definitely create a sticky for migrations PR-3 -> PR-4 known issues & current workaround.
    Otherwise it's a nightmare at each update.

    Even on the most basic things like :

    Application :
    Code:
    window.app = {
    	ns: 'MyApp'
    };
    
    
    Ext.application({
    
    
    	name: app.ns,
    	controllers: [],
    
    
    	launch: function() {
    		d&&console.log(app.ns + '.application#launch', [this, arguments]);
    
    
    		// Create Viewport
    		Ext.create(app.ns + '.view.Viewport');
    	}
    
    
    });
    Viewport :

    Code:
    Ext.define(app.ns + '.view.Viewport', {
    
    
    	id: 'viewport',
    	extend: 'Ext.Container',
    
    
    	config: {
    		layout: {
    			type: 'card',
    			animation: {type: 'slide'}
    		},
    		fullscreen: true
    	},
    
    
    	initialize: function() {
    		d&&console.log(Ext.getDisplayName(arguments.callee), [this, arguments]);
    
    
    		this.add([
    			{xtype: 'login'}
    		]);
    
    
    		this.callParent();
    	}
    
    
    });
    LoginView :

    Code:
    
    Ext.define(app.ns + '.view.Login', {
    
    
    	id: 'login',
    	alias: 'widget.login',
    	extend: 'Ext.form.FormPanel',
    
    
    	config: {
    		scrollable: false
    	},
    
    
    	initialize: function() {
            d&&console.log(Ext.getDisplayName(arguments.callee), [this, arguments]);
    
    
    		// Configure component
    		this.add([
    			{ xtype: 'spacer' },
    			{
    				xtype: 'container',
    				items:[
    					{
    					xtype: 'fieldset',
    					style: 'margin:4%;',
    					items: [
    					{
    						xtype: 'emailfield',
    						name: 'email',
    						placeHolder: 'email',
    						attributes: {autocorrect: 'off', autocapitalization:'off'},
    						required: true
    					}, {
    						xtype: 'passwordfield',
    						name: 'password',
    						placeHolder: 'password',
    						required: true
    					}
    					]},
    					{
    						xtype: 'button',
    						text: 'login',
    						action: 'login',
    						style: 'margin:4%;margin-bottom:3em;',
    						handler: function() {}
    					}
    				]
    			}
    		]);
    
    
    		// Events
    		this.on({
    			show: function() {}
    		});
    
    
            this.callParent();
        }
    
    
    });

  2. #2
    Sencha User Jacky Nguyen's Avatar
    Join Date
    Jul 2009
    Location
    Palo Alto, California
    Posts
    469
    Vote Rating
    14
    Jacky Nguyen has a spectacular aura about Jacky Nguyen has a spectacular aura about

      0  

    Default


    Simply move all the callParent() statements in all your initialize() up above the rest of the method body.
    Sencha Touch Lead Architect

  3. #3
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    19
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Seeing how many people have run into this issue, we're going to move initConfig out of initialize in the next release.

    Sencha Inc

    Jamie Avins

    @jamieavins

Thread Participants: 2