Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

requirejs + IE8: undefined object is null or not an object

I'm getting an error only in IE having to do with the require.js plugin.

I have the following code in require.js (line 1061):

 if (plugin.normalize) {

IE 8 is returning this error:

Message: 'normalize' is null or not an object

Line: 1061 Char: 25

I've checked the debugger and the plugin object exists, normalize is undefined. In javascript, this should evaluate as "false", and fail the if-condition. However, for some reason IE is throwing this error instead and not letting my page load correctly. Does anyone know why this is happening?

Ironically, if I change line 1061 to this:

if (plugin.normalize !== undefined && plugin.normalize !== null && plugin.normalize !== false) {

Then IE8 runs the code successfully...the problem is, this should be equivalent code, and I can't be altering third-party packages like require.js just to avoid IE bugs like this.

like image 889
Axle Avatar asked Nov 12 '22 22:11

Axle


1 Answers

I had a similar issue that I fixed by making sure that I had no trailing comas and that my paths were good.

More details here: https://github.com/jrburke/requirejs/issues/299

like image 57
Phillaf Avatar answered Jan 04 '23 01:01

Phillaf