New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stack Overflow Error when running a simple app in IE8 (started on Meteor 0.8.0) #2037
Comments
Thanks for the clear report @rainbough! I've verified this locally as well by running: |
We'll take a look at pull requests for this issue if someone gets to it before us. |
Here's a very simple reproduction: https://github.com/avital/meteor-user-bug-ie8 (thanks to @ManuelDeLeon) |
As a fun hint on how to debug this stuff, apply this diff: --- a/tools/bundler.js
+++ b/tools/bundler.js
@@ -709,7 +709,10 @@ _.extend(Target.prototype, {
allJs = minifiers.UglifyJSMinify(allJs, {
fromString: true,
- compress: {drop_debugger: false}
+ compress: {drop_debugger: false},
+ output: { beautify: true,
+ indent_level: 2,
+ width: 80 }
}).code;
self.js = [new File({ data: new Buffer(allJs, 'utf8') })]; Then, it pretty-prints after mangling. Then the IE8 error should be on a recognizable line. |
The minifier changed the two uses of HTMLTag into two different symbols: var n = function r() { var t = this instanceof e.Tag ? this : new r(), n = 0, o = arguments.length && arguments[0]; return o && "object" == typeof o && o.constructor === Object && (t.attrs = o, n++), n < arguments.length && (t.children = Array.prototype.slice.call(arguments, n)), t; }; return n.prototype = new e.Tag(), n.prototype.constructor = n, n.prototype.tagName = t, n; Then, IE8 apparently actually creates two separate objects for 'n' and 'r'; see #3 at http://kiro.me/blog/nfe_dilemma.html So just because n.prototype is an e.Tag doesn't make r.prototype a e.Tag This means that `new r() instanceof e.Tag` is false, and so the first line of the function leads to infinite recursion. I'm not sure if this is an uglify bug as well; dealing well with multiple declarations of the same function may be out of spec. Fixes #2037.
The minifier changed the two uses of HTMLTag into two different symbols: var n = function r() { var t = this instanceof e.Tag ? this : new r(), n = 0, o = arguments.length && arguments[0]; return o && "object" == typeof o && o.constructor === Object && (t.attrs = o, n++), n < arguments.length && (t.children = Array.prototype.slice.call(arguments, n)), t; }; return n.prototype = new e.Tag(), n.prototype.constructor = n, n.prototype.tagName = t, n; Then, IE8 apparently actually creates two separate objects for 'n' and 'r'; see #3 at http://kiro.me/blog/nfe_dilemma.html So just because n.prototype is an e.Tag doesn't make r.prototype a e.Tag This means that `new r() instanceof e.Tag` is false, and so the first line of the function leads to infinite recursion. I'm not sure if this is an uglify bug as well; dealing well with multiple declarations of the same function may be out of spec. Fixes #2037.
I just updated a live app to Meteor 0.8.0 about a week ago and shortly thereafter, we discovered that it no longer worked in internet explorer 8. It took a few days to figure out what was creating the error.
I have reproduced it here: https://github.com/rainbough/meteor0.8.0-ie8-bug
If you run this on a localhost it will work fine in IE8. The live site in IE8 shows a blank page and reports a stack-overflow error. The error occurs anytime a handlebars helper or template is enclosed in div tags like this:
It also comes up when the handlebars are in an attribute of an html tag:
Body tags don't seem to have any impact on it.
I also discovered that the modernizr-meteor package changes the error to an "exception thrown and not caught" error, which created a lot of confusion until I removed the package.
BTW the error comes up on both heroku hosted sites and meteor hosted sites.
The text was updated successfully, but these errors were encountered: