PDA

View Full Version : [FIXED] TypeError: 'undefined' is not a function (evaluating 'this.getInstance()')



apsq
15 Aug 2012, 2:19 AM
I'm getting the above error message when trying to import SA2.0 projects into SA2.1.

Afterwards, SA2.1 seems to hang, still showing the "This project is being upgraded..." dialog.

As the partially rendered canvas behind the dialog shows the viewport without any of the linked instances, I'm assuming this may have something to do with how linked instances are handled and referred to.

apsq
15 Aug 2012, 3:34 AM
I was able to isolate the cause in one of the projects and have attached a somewhat-minimal scenario (without this component, the project upgrade mostly works fine -- layout quirks aside).

I'm not sure which part of the component configuration is at fault here, but it causes an error (albeit a different one: something about "undefined") when loading the project with SA2.1.

mehran
15 Aug 2012, 4:57 AM
I'm facing the exact same problem. I've got two projects built by SA2 and just one of them can be opened with SA2.1. I'm getting the exact same prompt of "TypeError: 'undefined' is not a function (evaluating 'this.getInstance()')". Pressing its ignore button leads to another prompt which says "This project is being upgraded ..." and it never goes away. Closing and reopening the project leads to exact same scenario.

Phil.Strong
15 Aug 2012, 5:38 AM
Looks like the beta group needs to be much bigger for 2.2!

I'm going to check out broken.xda and let you know what I find.

apsq
15 Aug 2012, 5:47 AM
FWIW, SA2.1 itself seems to be unable to recover from this kind of error. The "upgrade" message and overlay seem to be stuck when it encounters an error like this. I had them remain there even after loading a succesfully upgraded project afterwards. Only restarting Architect works (to get rid of the modal message, not to fix the upgrade).

The lack of proper error handling and logging (stack traces anyone?) in Sencha Architect is shameful. When it encounters an error like this during a project upgrade, it will just leave the project in an incompletely upgraded state (after creating an XDA of the original project of course). Good thing everybody uses source control.

I'm not entirely sure how a component configuration that's the result of merely supplying legal values to the properties SA exposes on a component can lead to the project breaking in a new version of SA (or ExtJS, for that matter), but this isn't the first time I've run into this kind of problem.

Sorry for venting, but it's not like this is an open source project maintained by unpaid volunteers in their free time. For a three-figures price tag I think a certain sense of entitlement is justified.

Phil.Strong
15 Aug 2012, 10:19 AM
I appreciate your concerns. Know that stack traces are reported in our version of the application. Production is minified and encrypted so you can imagine this poses a challenge.

Upgrades are fairly volatile and have been discussed as a refactor target on more than on occasion. If you've built a system like this you can relate.

I'm working on hardening it up a bit while in there.

Phil.Strong
15 Aug 2012, 12:11 PM
I've found the real issue which was a healthy bug.

I've fixed that but I've also allowed for upgrades to fail and in the next patch will report which upgrades failed and the exception for each. Helping all of us get to the bottom of things faster.

the bug:
You'll find that any component with a date field set (has a date picker) will cause an error when you save the project **yikes**. A regression from our config refactor.

Expect a patch for this and other bugs next week

apsq
24 Aug 2012, 8:05 AM
Confirmed fixed in b588.