Uncaught TypeError: elem.nodeName.toLowerCase is not a
As soon as I click on the page, I get the follwing error:
Uncaught TypeError: elem.nodeName.toLowerCase is not a function
It fails inside shouldUseChangeEvent
, which looks as follows:
function shouldUseChangeEvent(elem) {
var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
}
from debugger, I can tell that elem
is pointing to the window object, which for some reason has a function called nodeName attached to it?!
from the console:
window.nodeName
( elem, name ) {
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
}
stack trace:
shouldUseChangeEvent @ ChangeEventPlugin.js:50
ChangeEventPlugin.extractEvents @ ChangeEventPlugin.js:287
EventPluginHub.extractEvents @ EventPluginHub.js:224
ReactEventEmitterMixin.handleTopLevel @ ReactEventEmitterMixin.js:33
handleTopLevelWithoutPath @ ReactEventListener.js:93
handleTopLevelImpl @ ReactEventListener.js:73
Mixin.perform @ Transaction.js:136
ReactDefaultBatchingStrategy.batchedUpdates @ ReactDefaultBatchingStrategy.js:62
batchedUpdates @ ReactUpdates.js:94
ReactEventListener.dispatchEvent @ ReactEventListener.js:204
For me it was an issue caused by jQuery 2.2.1. Updating to 2.2.4 has fixed problem.
The problem was caused by
nodeName
property added towindow
object.