PDA

View Full Version : Uncaught TypeError: Object prototype may only be an object or null



UserSenchasen
21 Jan 2014, 1:16 PM
Getting the error from the below app.js line:

Element.prototype.verticalStyleHooks90 = verticalStyleHooks90 = Ext.Object.chain(Element.prototype.styleHooks);

Gary Schlosberg
24 Jan 2014, 9:23 PM
Not sure that error message gives much information. The only thing I could find matching it was this:
https://www.assembla.com/spaces/bryntum/support/tickets/777#/activity/ticket:

Are you able to post a test case which reproduces the error, or figure out what part of your code is causing it?

gnanasuriyan
28 Feb 2014, 12:09 PM
I am also facing the same error after taking test build. The following lines are giving issues.

1. The starting point of the problem "http://docs.sencha.com/extjs/4.2.0/source/Element_style.html".
Ext.define('Ext.dom.Element_style', { override: 'Ext.dom.Element'},

2. The end point of the problem.
Element.prototype.verticalStyleHooks90 = verticalStyleHooks90 = Ext.Object.chain(Element.prototype.styleHooks);

Expecting some more information about this issue. Please share your thoughts.

Gary Schlosberg
3 Mar 2014, 10:44 AM
This is a very generic error message. Does the error occur with version 4.2.1? In which browsers are you seeing it. Can you post a test case?

gnanasuriyan
4 Mar 2014, 10:30 AM
I am checkin in Chrome browser( version 33.0.1750.117) and I am not facing any issues when development. I am getting this error only after taking test and production build(sencha build app testing). Currently I am using Ext JS version(ext-4.2.1.883).

Currently I am trying to find which part of the application is producing this error and update the forum soon.

twasink
14 Jun 2014, 9:04 PM
The problem is coming from this line, in Element_style.js (an override to Element.js):
Element.prototype.styleHooks = styleHooks = Ext.dom.AbstractElement.prototype.styleHooks;On the next line, this causes the error mentioned.The problem is that the Ext.dom.AbstractElement.prototype.styleHooks is undefined. I find this interesting, because the AbstractElement_style override - which defines the styleHooks - is running, and after it is run, the styleHooks are defined. However, by the time it gets to the Element_style override, it isn't anymore.This is with ExtJS 4.2.1 and Sencha Cmd 5.

twasink
14 Jun 2014, 9:34 PM
Okay - the problem seems to have been related to having two blocks. This was okay using Sencha Cmd 3 - but with Sencha Cmd 5 (dunno about 4) this causes the compiled app.js file to have multiple declarations of a lot of classes.

intro
27 Aug 2014, 3:11 AM
I am having the same problem ...:( can you explain how to solve it ..
What I have to check? (to not put any requires class two times or ?)
Why cmd is not showing error if is not working..

Thanks
Vladimir

hmcdaniel12
2 Oct 2014, 10:13 AM
I was seeing this problem. It was due to me stupidly loading a production minified app.js file and the ext-all.js file at the same time.

I removed the ext-all.js from the HTML so it loaded only the minified app.js.


<script src="/sbpsStatic/extjs-4.2.2/ext-all.js"></script>

Fixed the error.

Generally this is due to loading the same ext library code twice which I think other threads have already covered as a typical reason for this to occur.