PDA

View Full Version : [FIXED] Error Opening Project - TypeError: 'undefined' is not an object



timmcintyre
20 Apr 2012, 7:58 AM
After saving my project this morning, I just tried to restart Designer and I am now getting a TypeError: 'undefined' is not an object error. It opens up my project however I no longer have any controllers or views visible. The only thing I can see is my stores.

Any idea how to track down whats gone wrong ?

Tim

timmcintyre
20 Apr 2012, 9:25 AM
So Ive narrowed it down to a linked resource I just added. If I remove this from the metadata code, I can open my project, however I now need to add back in my linked resource. Once I close down Designer it wont open again until I manually fix this code .. any ideas why this is happening ?


, {
"id": "ExtBox1-ext-gen73583",
"type": "linkedinstance",
"reference": {
"name": "items",
"type": "array"
},
"codeClass": null,
"userConfig": {
"layout|region": "north",
"id": "ar_gridpanel"
},
"customConfigs": [],
"iconCls": "icon-linkedinstance",
"expanded": true,
"masterInstanceId": "ExtBox1-ext-gen73537"
}

aconran
23 Apr 2012, 9:06 PM
tim -

Any chance you could share an archive of your project with us on the architect team?

The broken one that is :) You can send it to designer.feedback at sencha.com and link this thread as a reference.

Phil.Strong
24 Apr 2012, 10:44 AM
I'm able to reproduce so we'll get to the bottom of it. Gimme a few

Phil.Strong
24 Apr 2012, 11:06 AM
Ok so solution time!

First I can't answer how you project got into this state though we are going to look a little bit deeper into the upgrade process to be sure we didn't cause this.

The issue is your BookingAddResources window had a linked instance that was no longer valid ... e.g. the id it had didn't exist in your project (ucmpGridBar) see line 1785 of metadata/view/BookAddResource.js

"masterInstanceId": "ucmpGridBar" --Error

replace this line with:
"masterInstanceId": "ExtBox1-ext-gen67263"

This id is the actual id of your GridBar component

I will tell you that in the past we didn't load up the components with dependencies in mind we assumed all would be available by the time you needed it. However this wasn't true in some cases so it now loads in order wrt dependencies and thus this new code that you are now breaking on. It's possible this was broken before and you just didn't know about it.

Lemme know if this fixes the issue.

timmcintyre
24 Apr 2012, 1:46 PM
Hi Phil,

Yep that did it, not sure how it ended up that way in the first place though. Might be worth expanding the error messaging in the designer to tell you where any errors like that may stem from.

Either way .. thanks for sorting out the issue . .Ive opened up the project & re-saved it with no issues

Cheers

Tim

Phil.Strong
25 Apr 2012, 12:47 PM
Yeah we've found some holes we hadn't thought of that are being fixed for the next update. Thanks for bringing this to light!

intellix
15 Jun 2012, 5:10 AM
I also have this issue but have something like 134 files to look through. No idea how I'm going to track down this in a reasonable time :/


Opened them all, searched for masterInstanceId in all files, copied all of the IDs, uniqued them and searched in all files for them all for something referencing something that no longer exists and couldn't find a problem

intellix
15 Jun 2012, 6:16 AM
Managed to get to the bottom of it. I copy and pasted my project then deleted parts of my project until it allowed me to save. I found the part that was killing my project.

So:

I have a Toolbar class, which is added to many pages, snippet:


{
"id": "ExtBox1-ext-gen177536",
"type": "toolbar",
"reference": {
"name": "items",
"type": "array"
},
"codeClass": null,
"userConfig": {
"cls": [
"toolbarBottom"
],


It's used on a container, which works:


{
"id": "ExtBox1-ext-gen72245",
"type": "linkedinstance",
"reference": {
"name": "items",
"type": "array"
},
"codeClass": null,
"userConfig": {},
"customConfigs": [],
"iconCls": "icon-linkedinstance",
"expanded": true,
"masterInstanceId": "ExtBox1-ext-gen177536"
}


And used on a nestedlist, which did not work:



{
"id": "ExtBox1-ext-gen26679",
"type": "linkedinstance",
"reference": {
"name": "toolbar",
"type": "object"
},
"codeClass": null,
"userConfig": {},
"customConfigs": [],
"iconCls": "icon-linkedinstance",
"expanded": true,
"masterInstanceId": "ExtBox1-ext-gen177536"
}


Had a little play with replicating it again. It seems I can't drag in my bottom toolbar into a Nestedlist as it doesn't let me... But I can duplicate a link of it and drag that into it instead

Phil.Strong
18 Jun 2012, 7:11 AM
I don't quite understand the steps but you're reporting a bug, right?


Had a little play with replicating it again. It seems I can't drag in my bottom toolbar into a Nestedlist as it doesn't let me... But I can duplicate a link of it and drag that into it instead


Can you give me exact steps dumbed down e.g. add a toolbar, drag the toolbar, etc ...

that would be uber helpful if you think this is in fact a bug

intellix
18 Jun 2012, 7:43 AM
I've given each component an ID so you can see which ones are new

Drag a new container(1) into Views
Drag a new nestedlist(2) into Views
Drag a new toolbar(3) into nestedlist
Drag a new toolbar(4) into Views
Drag that toolbar(4) into container(1) > Link it(5)
Duplicate the linked toolbar(5) within the container(1) so there is another linked Toolbar(6).
Drag the second linked Toolbar(6) into the nestedlist(3) (you now have two toolbars within your nestedlist)

It seems it doesn't know the linked instance (white dot with blue line) is a toolbar so it lets you have as many as you want in there