{"action":"created","issue":{"url":"https://api.github.com/repos/meteor/meteor/issues/8928","repository_url":"https://api.github.com/repos/meteor/meteor","labels_url":"https://api.github.com/repos/meteor/meteor/issues/8928/labels{/name}","comments_url":"https://api.github.com/repos/meteor/meteor/issues/8928/comments","events_url":"https://api.github.com/repos/meteor/meteor/issues/8928/events","html_url":"https://github.com/meteor/meteor/issues/8928","id":244196613,"number":8928,"title":"Unable to run any Meteor app on iPad 1G via `meteor build` or via `meteor --production`: throws a JS error","user":{"login":"vflyson","id":1392048,"avatar_url":"https://avatars1.githubusercontent.com/u/1392048?v=4","gravatar_id":"","url":"https://api.github.com/users/vflyson","html_url":"https://github.com/vflyson","followers_url":"https://api.github.com/users/vflyson/followers","following_url":"https://api.github.com/users/vflyson/following{/other_user}","gists_url":"https://api.github.com/users/vflyson/gists{/gist_id}","starred_url":"https://api.github.com/users/vflyson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vflyson/subscriptions","organizations_url":"https://api.github.com/users/vflyson/orgs","repos_url":"https://api.github.com/users/vflyson/repos","events_url":"https://api.github.com/users/vflyson/events{/privacy}","received_events_url":"https://api.github.com/users/vflyson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-07-19T22:47:02Z","updated_at":"2017-07-22T20:19:33Z","closed_at":null,"body":"iPad 1G reports an error on line :55 within the main .js bundle for a sample app created via `meteor create simple-todos`. The error description is: \"SyntaxError: Parse error\". Same happens with my other apps, just the line number varies, same block of code though.\r\n\r\nThis is the latest Meteor of version 1.5.1, and the error does not get thrown when ran in development mode via `meteor`.\r\n\r\n[[the link to pastbin with the code from line 55](https://pastebin.com/Y3xn93LX)] I... assume it could be those Unicode symbols within the code?\r\n\r\nupd: tried running `simple-todos` via `meteor --production --release 1.5`; same result, same line 55. Happens only on iPad 1G (iPhone 5 works fine, so it's not an iOS issue, at least not with the latest one).\r\n\r\nupd 2: changed babel to version `^6.23.0` from `^6.20.0` in `package.json` -- no go, still error on line 55 within .js when used via iPad 1G.\r\n\r\nupd 3: so it seems like there's a byte sequence within that line which mirrors the line horizontally (both on pastebin.com via Chromium and within my desktop IDE)... so e.g. word `constructor` gets rendered as `rotcurtsnoc`, yet I'm able to find by searching for \"const\". Apparently that's the byte which messes up the old iOS' JS engine. I have no other explanation for the bug that I found.\r\nI think I can say that I've seen too much in my life at this point.\r\n\r\nupd 4: this seems to be the uncompressed chunk of code that causes the issue: https://github.com/meteor/meteor/blob/87681c8f166641c6c3e34958032a5a070aa2d11a/packages/ddp-client/sockjs-0.3.4.js#L407\r\nPlease note how there are no unicode chars within the original (L407), only within the minified version (pastebin). The minification does something to that code, so old JS engines trip on it and refuse to compile.\r\n\r\nupd 5: \r\nI can confirm that removing package `standard-minifier-js@2.1.1` from .meteor/packages solves the issue, yet it ends up leaving my app uncompressed (therefore unsuitable for being deployed to production).\r\n\r\nupd 6:\r\nThe issues seems to be triggered by the right-to-left unicode control character mark, here's an example (try selecting the code within the highlight): `<span class=\"st0\">\"‮\"</span>`"},"comment":{"url":"https://api.github.com/repos/meteor/meteor/issues/comments/317208073","html_url":"https://github.com/meteor/meteor/issues/8928#issuecomment-317208073","issue_url":"https://api.github.com/repos/meteor/meteor/issues/8928","id":317208073,"user":{"login":"vflyson","id":1392048,"avatar_url":"https://avatars1.githubusercontent.com/u/1392048?v=4","gravatar_id":"","url":"https://api.github.com/users/vflyson","html_url":"https://github.com/vflyson","followers_url":"https://api.github.com/users/vflyson/followers","following_url":"https://api.github.com/users/vflyson/following{/other_user}","gists_url":"https://api.github.com/users/vflyson/gists{/gist_id}","starred_url":"https://api.github.com/users/vflyson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vflyson/subscriptions","organizations_url":"https://api.github.com/users/vflyson/orgs","repos_url":"https://api.github.com/users/vflyson/repos","events_url":"https://api.github.com/users/vflyson/events{/privacy}","received_events_url":"https://api.github.com/users/vflyson/received_events","type":"User","site_admin":false},"created_at":"2017-07-22T20:19:33Z","updated_at":"2017-07-22T20:19:33Z","body":"Okay, so I've switched away from `standard-minifier-js@2.2.1` in favor of `ssrwpo:uglifyjs2` -- that one lets you configure options via your app's `package.conf`. The good news: I've managed to build it to run on iPad 1G (I suppose my app will work in Tesla's browser now as well, tho haven't tried yet). More good news: the parse error happens with both ascii_only on and off, which means the unicode bytes merely make it hard to disassemble the file. I'll keep them on for now, even though it's still weird af to be having a raw ltr order mark within the code.\r\nWhat seems to be causing the error for older browsers is this UglifyJS2 option set to true: `collapse_vars`.\r\nSo I've managed to solve this issue by using this config for the aforementioned package:\r\n```\r\n  \"uglifyjs2\": {\r\n    \"options\": {\r\n      \"compress\": {\r\n        \"collapse_vars\": false,\r\n        \"global_defs\": {\r\n          \"UGLYFYJS_DEAD\": false\r\n        }\r\n      }\r\n    }\r\n  }\r\n```"}}
{"actor":{"display_login":"vflyson"}}