PDA

View Full Version : Deployment Error Sencha SDK Tools: 'TypeError: 'undefined' is not an object'



JDMOE
22 Jul 2011, 12:38 AM
When I try to generate the .jsb3 file for the example application feed-viewer which is shipped with the Ext JS4 package using

sencha create jsb -a feed-viewer.html -p app.jsb3
I get the following error message:

undefined:0 TypeError: 'undefined' is not an object
(The example from the API Docs http://docs.sencha.com/ext-js/4-0/#/guide/getting_started works fine)
I'm using the current Sencha SDK Tools (beta) on a Mac.

Thanks for any help!

ssamayoa
22 Jul 2011, 8:13 PM
Any news about this?

I just get the same problem!

Funny thing, I've already generated jsb3 file for my application but now fails.

Regards.

ssamayoa
22 Jul 2011, 8:30 PM
Never mind, me bad:
I mistakely copied production index to development index.
Regards.

JDMOE
24 Jul 2011, 10:56 PM
I actually realized that the error message already appears in the JavaScript console of the Browser (using the Feed Viewer example above). In the Safari console I get

TypeError: Result of expression 'o' [undefined] is not an object. in the class ext-all-debug.js line 17233 (GPL version http://www.sencha.com/products/extjs/download/ext-js-4.0.2a/213).

In firefox and Chrome I get similar messages

Error: o is undefined in firefox and

Uncaught TypeError: Cannot read property 'id' of undefined in Chrome respectively.

Any ideas what might cause the problem?

gabrielle
25 Jul 2011, 4:40 AM
Hi JDMOE,

I don't get such an error with the online feed-viewer example: http://dev.sencha.com/deploy/ext-4.0.2a/examples/app/feed-viewer/feed-viewer.html

JDMOE
25 Jul 2011, 4:43 AM
A similar ErrorMessage can be constructed using the deployment example of the GettingStarted API Docs (http://docs.sencha.com/ext-js/4-0/#/guide/getting_started).
When removing the line

Ext.require('Ext.container.Viewport'); from the file app.js, the command

sencha create jsb -a index.html -p app.jsb3 results in the ErrorMessage

undefined:0 TypeError: 'null' is not a constructor
In this case, no ErrorMessage appears in the JavaScript console of the browser.

Is there any way to produce a more specific ErrorMessage, or recover the missing 'Ext.require..' in a different way?

Thanks for any help
Jan

JDMOE
25 Jul 2011, 4:46 AM
Hi gabrielle,

thanks for the answer. On a different machine (linux and no Mac) I also did not get the error.

Any suggestions what might cause it?

On the other hand, as you can read above. One can reproduce an error similar to the original one using the example from the GettingStarted guide from the API Docs.

gabrielle
25 Jul 2011, 10:37 AM
Jan,

try to pass the full path to feed-viewer.html. See here (http://www.sencha.com/forum/showthread.php?140600-Deployment-Error-with-Sensha-SDK-Tool-null-is-not-a-constructor).

stevil
26 Jul 2011, 10:19 AM
When I try to generate the .jsb3 file for the example application feed-viewer which is shipped with the Ext JS4 package using

sencha create jsb -a feed-viewer.html -p app.jsb3
I get the following error message:

undefined:0 TypeError: 'undefined' is not an object
(The example from the API Docs http://docs.sencha.com/ext-js/4-0/#/guide/getting_started works fine)
I'm using the current Sencha SDK Tools (beta) on a Mac.

Thanks for any help!

+1 - same error running



ext-theme -d .\ext-4.0.5 -c resources\css\mytheme.css -o mytheme -v


stevil

JDMOE
27 Jul 2011, 6:03 AM
Hi gabrielle,

thanks for the answer. It did however not resolve the problem for me. The error remains the same.

zombeerose
27 Jul 2011, 9:30 AM
I am getting the same error

TypeError: 'undefined' is not an object
Line: 0
Source: undefined
when running the SDK against Ext 4.0.5.

My command for Ext 4.0.4 runs cleanly:

/cygdrive/c/PROGRAMMER/SenchaSDKTools-1.2.2/command/sencha.bat slice theme -v -d htdocs\\includes\\library\\extjs\\ext-4.0.4 -c htdocs\\includes\\library\\extjs\\my\\resources\\css\\theme.css -o htdocs\\includes\\library\\extjs\\ext-4.0.4/resources\\themes\\images\\my\\


But the Ext 4.0.5 command fails:

/cygdrive/c/PROGRAMMER/SenchaSDKTools-1.2.2/command/sencha.bat slice theme -v -d htdocs\\includes\\library\\extjs\\ext-4.0.5 -c htdocs\\includes\\library\\extjs\\my\\resources\\css\\theme.css -o htdocs\\includes\\library\\extjs\\ext-4.0.5/resources\\themes\\images\\my\\

The double backslashes are necessary.

FoxMulder900
31 Aug 2011, 12:10 PM
Ok, I am getting this exact same error, I have tried both the URL and just index.html. Does this mean I am missing an Ext.require somewhere? If so how do I tell where to look?

The only warning I get in my console when my page loads is "Store defined with no model. You may have mistyped the model name." my understanding was this warning is from having a TreeStore and will supposedly be fixed in 4.1 but could it have anything to do with my build error?

stevil
31 Aug 2011, 12:26 PM
@zombeerose,

4.0.6 just dropped today, and fixed this problem for me.

stevil

Dehru
28 Sep 2011, 11:56 AM
We had a few lines of javascript above the Ext.application({...}) in our app.js file. For us, this produces the error. When we removed those lines it solved our problem.

jithsajith
18 Oct 2011, 11:56 PM
Hiii...
I am new to extJs. I also got the same error message Undefined is not an Object. When I checked in detail the xtype I gave was incorrect. I believe this error occurs when U gave an incorrect xtype.

Regards

Dehru
19 Oct 2011, 7:29 AM
I have found that the error is produced when I use a static html file vs one served from http:// But the jsb3 file is fine.

I get the error from this command:


sencha create jsb -a index.html -p app.jsb3


But not this command using http://:

sencha create jsb -a http://localhost:9090/app/index.html -p app.jsb3


But in both cases, the jsb3 file is fine. I didn't realize this at first...I assumed the error caused a failure to build the file.