Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Custom modernizr builds crash IE8 #332

Closed
thasmo opened this Issue · 64 comments
@thasmo

We have experienced that custom, compressed modernizr builds crash IE8,
resulting in showing this address in the addressbar:
res://ieframe.dll/acr_error.html/#

This is not happening in the compat modes of IE7 or IE8 in IE9.

Unfortunately we can't really test this any further as we don't have
a machine with IE8 installed. The machine we experienced this on,
was a Windows XP machine of one of our partner companies.

Using the uncompressed development version does work without errors:
http://www.modernizr.com/downloads/modernizr-2.0.6.js

@dottodot

I have the same problem, if I use the uncompressed version I do not have this issue.

I have ie8 to test on but not sure how to find whats causing the problem.

@gordonbrander

Having the same issue with the following build in IE 8.0.6.001.18702/XP:

/* Modernizr 2.0.6 (Custom Build) | MIT & BSD
 * Contains: iepp | respond | mq | cssclasses | teststyles
 */

I have not yet tested with other builds.

@gordonbrander

Update: also tested it with a full build using the generator:

/* Modernizr 2.0.6 (Custom Build) | MIT & BSD
 * Contains: fontface | backgroundsize | borderimage | borderradius | boxshadow | flexbox | hsla | multiplebgs | opacity | rgba | textshadow | cssanimations | csscolumns | generatedcontent | cssgradients | cssreflections | csstransforms | csstransforms3d | csstransitions | applicationcache | canvas | canvastext | draganddrop | hashchange | history | audio | video | indexeddb | input | inputtypes | localstorage | postmessage | sessionstorage | websockets | websqldatabase | webworkers | geolocation | inlinesvg | smil | svg | svgclippaths | touch | webgl | iepp | respond | mq | cssclasses | addtest | prefixed | teststyles | testprop | testallprops | hasevent | prefixes | domprefixes | load
 */

Update: this is almost certainly related: scottjehl/Respond#27.

I removed Modernizr from my page in order to test, and added HTML5 Shiv + Respond.js instead. WIth respond.js, the page throws this error in IE 8.0.6.001.18702/XP. Without, it's fine.

Update 2: The issue definitely seems to be related to respond.js for me. Built the following:

/* Modernizr 2.0.6 (Custom Build) | MIT & BSD
 * Contains: iepp | cssclasses | load
 */

...and it runs no problem in IE8/XP. Adding respond.js to the build throws the error.

@paulirish
Owner

hmmmmm @scottjehl we got a problem it seems.

@thasmo

Any progress on this? Wondering where I can get a Win XP version for testing this. :|

@thasmo thasmo closed this
@thasmo thasmo reopened this
@thasmo

Oops. oO The GUI mocked me. oO

@plockc

There is a comment with 8 bit bytes near the method

tests['csstransforms3d']

that has what I'm guessing is a Microsoft "smart-quote"

We experience crashes of IE8 when we do not set a charset when serving this file (like running under lighttpd)

our fix: remove the comment

@paulirish
Owner

@plockc you've built this version recently? can you give us the top of the file which has what tests are in the build?

@paulirish
Owner

remove what comment?

@plockc

(sorry for all the edits, trying to figure out the code delimiters)

I didn't see what looked like a list of tests (sorry, I'm helping the markup guys, I don't use the library myself), but here is the version:

/*!
 * Modernizr v2.0.6
 * http://www.modernizr.com
 *
 * Copyright (c) 2009-2011 Faruk Ates, Paul Irish, Alex Sexton
 * Dual-licensed under the BSD or MIT licenses: www.modernizr.com/license/
 */

Asking the markup guy that got it, it should be a full build, pulled from here:
http://www.modernizr.com/downloads/modernizr-2.0.6.js

which I verify to have the same 8 bit bytes

The comment is here:

    tests['csstransforms3d'] = function() {

        var ret = !!testProps(['perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective']);

        // Webkit<89>۪s 3D transforms are passed off to the browser's own graphics renderer.
        //   It works fine in Safari on Leopard and Snow Leopard, but not in Chrome in
        //   some conditions. As a result, Webkit typically recognizes the syntax but
        //   will sometimes throw a false positive, thus we must do a more thorough check:
        if ( ret && 'webkitPerspective' in docElement.style ) {

          // Webkit allows this media query to succeed only if the feature is enabled.
          // `@media (transform-3d),(-o-transform-3d),(-moz-transform-3d),(-ms-transform-3d),(-webkit-transform-3d),(modernizr){ ... }`
          ret = Modernizr['csstransforms3d'];
        }
        return ret;
    };

the first line of the comment should have been "WebKit's" I assume

Here is a test I use (found a high byte in jQuery 1.6.4.min with it as well):

hexdump -v -e '1/1 "%02X" "\n"' modernizr.js   | awk '/^[8-9A-F]/ {print NR " " $0} /[0-7]?/ {}'

Checking the latest from github, someone appears to be editing source code with a "smart quotes" editor and saving the file in UTF-8 (I think), there are many high byte sequences, for example hex E2 80 99 is a right single quote:

curl -o modernizr.js https://github.com/Modernizr/Modernizr/blob/master/modernizr.js

hexdump -v -e '1/1 "%02X" "\n"' modernizr.js   | awk '/^[8-9A-F]/ {print NR " " $0} /[0-7]?/ {}'

(each line of output is a decimal offset and the byte value in hex)
14516 E2
14517 86
14518 91

14557 E2
14558 86
14559 93

15842 E2
15843 80
15844 A6

171271 E2
171272 80
171273 99

286370 E2
286371 86
286372 90

286520 E2
286521 86
286522 92

286671 E2
286672 86
286673 91

286819 E2
286820 86
286821 93

287169 E2
287170 86
287171 90

287343 E2
287344 86
287345 92

287518 E2
287519 86
287520 91

287690 E2
287691 86
287692 93
@paulirish paulirish closed this in ee030ad
@paulirish
Owner
@AndrewHenderson AndrewHenderson referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@lode

I'am also having the issue of a 'crashing' IE8. The tab crashes and show indeed res://ieframe.dll/acr_error.html/#domain.ext,http://www.domain.ext/.

I'am using the minified version (from the html5 boilerplate) and can't find the comment in my modernizr source which is changed in the previous commit. Is this really all needed to fix this issue? To me it seems this won't help.

@paulirish
Owner

@lode i would also get a minified version that does not include respond.js

@lode

@paulirish but it seems to me that I do need respond.js.

(Right now I've been able to "solve" it by using the development version of modernizr and minify it myself via jscompress.com. This one doesn't crash.)

@paulirish
Owner

you dont need respond.js.. you can do mobile-first MQs and get IE support with a conditional comments and two css files.

interesting bug though. :o

@thasmo

Does this bug depend on shipping modernizr 2.1? Will it be fixed? Thanks guys!

@whereisaaron

One data point for sufferers; We found that the attribute that triggered the IE crashes when combined with Modernizr was related to 'print' vs 'screen' style sheets 'media' attribute. We found that is you explicitly say 'screen' (which as you know is the default anyway) that leads to the IE crash. Here is the versions offending line:

1) <link rel="stylesheet" href="/css/style.css"> --> No crash
2) <link rel="stylesheet" href="/css/style.css" media="print"> --> No crash
3) <link rel="stylesheet" href="/css/style.css" media="screen"> --> Crash!

We found if we avoid (3) we could avoid the IE crashes.

We have not used @import but with do use @media, e.g. '@media only screen and (min-width: 480px)'
CSS files that do not use @import or @media do not trigger the problem, even if you do explicitly specify 'media="screen"'.

Aaron.

@paulirish
Owner

aaron fwiw this is a respond.js bug.

@scottjehl
@whereisaaron

Excellent Scott, glad this problem is fixed, but this problem was reported with 2.0.6 and I believe there hasn't been a release of Modernizr since the fix. So people using the current release version from http://www.modernizr.com/ (still 2.0.6 as of today) are still as far as I know getting the old version of Media Queries portion with this problem?
[ Of course since IE7/IE8 crash and burn the really problem it with IE and of course will probably never be fixed :-( ]

@scottjehl
@paulirish
Owner
@scottjehl
@donaldjenkins

I'm getting the crash in IE 6/7/8 with a Modernizr 2.5.2 custom build (was not getting it with Modernizr 2.0.6).

@scottjehl
@SherriAlexander

I echo astorg's comment; just upgraded a site I've been working on to modernizr 2.5.2, and started getting hard crashes in IE 8. Went back to 2.0.6 and no crashes. I don't think respond.js is involved, as my custom build did not include it.

Here is the custom build I was using in case it helps track down the problem:

Modernizr 2.5.2 (Custom Build) | MIT & BSD
Build: http://www.modernizr.com/download/#-fontface-generatedcontent-input-inputtypes-shiv-cssclasses-teststyles-load

@donaldjenkins

Oh, so I'm not alone. Yup—it can't be respond.js as it's no longer included. So surely wouldn't make sense to file a bug in the respond.js issues tracker. My build, in case that helps, is:

http://www.modernizr.com/download/#-borderradius-boxshadow-opacity-video-inputtypes-shiv-cssclasses-testprop-testallprops-prefixes-domprefixes-load

@KuraFire
Owner

Are any of the people who are seeing crashes since 2.5.2 using Typekit? If so, see #308 for a potential fix. cc @astorg @SherriAlexander

@SherriAlexander

I'm using some custom fonts via @font-face, but not using Typekit on this project.

@scottjehl
@donaldjenkins

I'm using Typekit so that's the likely reason (though, again, no issues with 2.0.6). What fix are you suggesting: calling Typekit before Modernizr, using html5.shivMethods = false;, or using:

test: Modernizr.fontface,
yep: 'http://use.typekit.com/ypq0ypv.js',
callback: function () {
html5.shivMethods = false; // IE6 and 7 crash without this line
try { Typekit.load(); }
catch(e){}
}

Using test: Modernizr.fontfacewould require adding in a scenario for browsers that don't support @fontface: seems overkill if one of the otrher solutions works.

@KuraFire
Owner

@astorg The issue is that html5.shivMethods does the "innerShiv" functionality a little bit too aggressively for oldIE as of the new html5shiv 3.x (I think 3.x, anyway). Typekit uses that functionality but when something is already attached to the DOM and you change it, oldIE goes kaput.

The specific Modernizr.load / yepnope setup that I'm using is irrelevant here. You just need to set html5.shivMethods to false before the Typekit.load(); call to fix it, however you have your setup. Keep in mind that this is very much a temporary workaround !

@donaldjenkins

@KuraFire: Gotcha! I'll try that. Alternatively, I might just stick with 2.0.6, pending a more permanent fix. The main benefit of 2.5, for me, is speed (it does load faster in non-IE browsers). When you say temporary, what time frame are you talking about?

@KuraFire
Owner

@astorg Alex, Alexander et al are pretty on top of it, it seems. I can't speak for them or make any guarantees, but at the rate of fixes of late, I'd say only a matter of days.

@donaldjenkins

@KuraFire Cool, I think I'll hold off pending a more permanent fix. Thanks for the prompt response!

@SherriAlexander

I will try to do some more debugging and narrow it down to a culprit in my case, but I have to tame my raging project deadlines first. :)

@ryanve

I got the IE8 acr error when I upgraded the Modernizr build to 2.5.2 on two sites. Here's a screenshot. On responsejs.com it hit the error as soon the page opened. On virtualmusic.tv it hit the error after clicking a link. No Typekit in either case, and no respond.js when I tested it. I tried several different builds and I think it's isolated to the something in the new shiv. I have a computer that can test this if needed.
modernizr.com/download/#-shiv-cssclasses causes acr error
modernizr.com/download/#-cssclasses-load works fine

@zdennis

We are experiencing this with shiv's alone in 2.5.2: http://www.modernizr.com/download/#-shiv

@zdennis

If I don't include html5shiv but I include most other things the problem doesn't happen. Separately adding in http://code.google.com/p/html5shiv/ seems to keep everything happy.

@zdennis

To update, this issue happened on IE8 on Windows XP in Vmware Fusion. A colleague loaded in in IE8 on Windows 7 in Parallels and didn't experience any issues.

@SherriAlexander
@agross

I see the issue with IE 8 on Windows Server 2003 R2 SP2 (base OS is similar to XP) as well.

Using the Modernizer 2.5.2 build without customizations (just html5shiv, load and the CSS classes without prefix). I don't use respond.js.

I've created a little reproduction over here: agross/modernizr-bug-332@cad5b14

@Krinkle

The custom Modernizer 2.5.2 build that ships with the latest version of the HTML5 Boilerplate is also causing complete browser shutdown crashes in IE8 on XP for me.

Please for this as soon as possible, reverting to 2.0.6 now.

After re-trying a couple of times, sometimes the browser doesn't crash but instead tries to re-load it a couple of times after failed attempts and eventually ends up at a url like res://ieframe.dll/acr_error.htm# *(domain, url). Also during the reloads it's showing a tooltip in the IE8 tab saying "This tab has been recovered".

@paulirish paulirish reopened this
@paulirish
Owner

reopening.

@aFarkas could you look at agross's testcase?

@aFarkas
Owner

Yeah, I will look into this issue. Just downloaded the testcase and I can reproduce the issue. Will work on this tomorrow :-)

@dmethvin

This seems very similar to http://bugs.jquery.com/ticket/9823 FWIW.

@aFarkas
Owner

@dmethvin

Yeah, I'm pretty sure that this is the reason for this bug. Will look later into this and let you know.

@scottjehl

Same bug used to occur with Respond.js. This change fixed it. scottjehl/Respond@8016973

@aFarkas
Owner

@dmethvin and @scottjehl

Yes it turns out this was the bug. It came from html5shiv. Actually the fakeBody isn't really needed, because we tested wether a element with a hidden property is display: none. In fact all known browsers, which have implemented the hidden property also have implemented the corresponding style. So easy to fix + less code

@aFarkas aFarkas closed this
@necolas

@scottjehl FYI: This is the fix used by jQuery - http://bugs.jquery.com/ticket/9823

@aFarkas The bug is still present in Modernizr (#501) due to a fake body being used in the tests, but looks like it can be fixed with the same fix the jQuery project used (worked for me). Thanks

@aFarkas
Owner

@necolas

Are you sure about this? I saw the fakeBody in Modernizr, but I didn't touched the logic there, because it worked for me in my and in your testcase (no crash). Although, I was asking myself, wether I should be more paranoid and simply setting the background style for fakeBody as well.

@necolas

@aFarkas I don't think my testcase includes the html5shiv. Nor did jQuery 1.6.2. When I get home, I'll test again using the latest Modernizr from the repo and see if the problem remains. Thanks.

@aFarkas aFarkas referenced this issue from a commit
@aFarkas aFarkas fix issue #332 and issue #501 971dba3
@aFarkas
Owner

@necolas

Ok, I haven't used your testcase. I was using @agross's one. And in your testing Modernizr also produced this crash. Now it is fixed doubble :-). Thanks for your this.

@joelhaasnoot

This looks like a fix for my issue, but is there anyway to make a custom build of the dev version? (or when will this fix be released?)

@zdennis

@aFarkas's changeset in b15f9bf fixed this issue for me. Thank you for the fix!

@paulirish
Owner

Modernizr 2.5.3 has now shipped including this fix.

http://www.modernizr.com/download/

:)

@donaldjenkins

Hurrah!!!! Thanks Paul.

@ryanve

Thanks everyone—it's solid now =]

@alanfluff

+1 With those thanks—here too custom 2.5.2 was crashing, custom 2.5.3 is rock solid.

:)

@distilledhype

Thanks for fixing this guys! Just spent an afternoon wondering why IE 7 and 8 were constantly crashing on me...

@tobsch

for me, a custom 2.5.3 is crashing ie 7.00.5730.13.
used in an iframe.

any hints on how to debug?

@ryanve

@tobsch Try different custom builds with different options selected to isolate which component is causing the crash. My guess is that it's the shiv or the print shiv b/c that caused the crash before. First try comparing a build with and without the shiv to see if it's the shiv. Also compare with a development build. Is the error you see the acr_error or something different?

@aFarkas
Owner

@tobsch
Do you have any new information on this? @ryane gave you some good starting points to look at. In case a build without html5shiv doesn't cause the crash. Also try to embed the most recent html5shiv version. You can get it here: https://github.com/aFarkas/html5shiv/blob/master/src/html5shiv.js

@gregarious

If anyone still experiencing this issue is getting their custom builds from initializr, it's due to an outdated Respond script.

The Respond folks fixed it with this commit (scottjehl/Respond@ed8479c), but the initialzr modules using Respond still haven't pulled in these changes.

Stay tuned to verekia/initializr#43.

@phistuck phistuck referenced this issue from a commit
@phistuck phistuck fix issue #332 and issue #501 d08f703
@patrickkettner patrickkettner referenced this issue from a commit in patrickkettner/Modernizr
@aFarkas aFarkas update html5shiv to vpre 3.4 fixes Issue #332 dc033ea
@patrickkettner patrickkettner referenced this issue from a commit in patrickkettner/Modernizr
@aFarkas aFarkas fix issue #332 and issue #501 23b9ff9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.