Legacy browsers - Unexpected token '>'

Hello guys,

i’m facing error on old browser ( from what i checked it has to fall under legacy build )

Log from sentry:

SyntaxError
Unexpected token '>'

41

package.json :

{
  "name": "xyzcom",
  "private": true,
  "scripts": {
    "start": "meteor --port 4000 --settings settings.dev.json",
    "start:fast": "METEOR_OFFLINE_CATALOG=1 meteor --port 4000 --settings settings.dev.json",
    "start:debug": "meteor --settings settings.dev.json --inspect",
    "deploy": "DEPLOY_HOSTNAME=galaxy.meteor.com meteor deploy  --settings ./settings.prod.json",
    "lint": "eslint .",
    "pretest": "npm run lint --silent"
  },
  "dependencies": {
    "@babel/runtime": "^7.1.2",
    "babel-runtime": "^6.20.0",
    "bcrypt": "^1.0.3",
    "bufferutil": "^4.0.0",
    "classnames": "^2.2.5",
    "const": "^1.0.0",
    "dateformat": "^3.0.3",
    "dropbox-v2-api": "^2.1.19",
    "fs-extra": "^7.0.0",
    "lodash": "^4.17.10",
    "meteor-node-stubs": "~0.2.4",
    "moment": "^2.22.2",
    "node-qrcode": "0.0.4",
    "postmark": "^1.6.1",
    "qr-image": "^3.2.0",
    "qrcode": "^1.3.0",
    "qrcode.react": "^0.8.0",
    "query-string": "^6.1.0",
    "react": "^16.5.2",
    "react-copy-to-clipboard": "^5.0.1",
    "react-csv": "^1.0.14",
    "react-datepicker": "^1.6.0",
    "react-datetime": "^2.15.0",
    "react-dom": "^16.0.0",
    "react-moment": "^0.7.9",
    "react-qr-reader": "https://github.com/athyuttamre/react-qr-reader",
    "react-router-dom": "^4.2.2",
    "react-router-prop-types": "^1.0.4",
    "react-show-more-text": "^1.0.3",
    "react-spinner": "^0.2.7",
    "react-stripe-elements": "^1.1.0",
    "react-toastify": "^4.3.1",
    "reactstrap": "^6.5.0",
    "simpl-schema": "^0.3.2",
    "stripe": "^5.1.1",
    "svg-to-img": "^2.0.7",
    "tachyons": "^4.8.1",
    "tar-fs": "^1.16.3",
    "utf-8-validate": "^5.0.1",
    "zip-folder": "^1.0.0"
  },
  "devDependencies": {
    "@meteorjs/eslint-config-meteor": "^1.0.5",
    "babel-eslint": "^8.2.3",
    "eslint": "^4.19.1",
    "eslint-config-airbnb": "^16.1.0",
    "eslint-import-resolver-meteor": "^0.4.0",
    "eslint-plugin-import": "^2.12.0",
    "eslint-plugin-jsx-a11y": "^6.0.3",
    "eslint-plugin-meteor": "^5.0.0",
    "eslint-plugin-react": "^7.9.1"
  }
}

.meteor/packages

cat .meteor/packages 
# Meteor packages used by this project, one per line.
# Check this file (and the other files in this directory) into your repository.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.

meteor-base@1.4.0             # Packages every Meteor app needs to have
mobile-experience@1.0.5       # Packages for a great mobile UX
mongo@1.6.0                   # The database Meteor supports right now
blaze-html-templates@1.0.4 # Compile .html files into Meteor Blaze views
reactive-var@1.0.11            # Reactive variable for tracker
tracker@1.2.0                 # Meteor's client-side reactive programming library

standard-minifier-css@1.5.0   # CSS minifier run for production mode
standard-minifier-js@2.4.0    # JS minifier run for production mode
es5-shim@4.8.0                # ECMAScript 5 compatibility for older browsers
ecmascript@0.12.0              # Enable ECMAScript2015+ syntax in app code
shell-server@0.4.0            # Server-side component of the `meteor shell` command

react-meteor-data
dburles:collection-helpers
alanning:roles
aldeed:collection2-core@2.0.1
google-config-ui@1.0.1
mdg:validated-method
accounts-ui@1.3.1
mdg:meteor-apm-agent
meteorhacks:zones
fortawesome:fontawesome
percolate:migrations
meteorhacks:aggregate
mixmax:smart-disconnect
underscore@1.0.10
server-render@0.3.1
check@1.3.1
accounts-facebook@1.3.2
accounts-password@1.5.1
service-configuration@1.0.11
accounts-google@1.3.2
mdg:validation-error
email@1.2.3
ostrio:files

./meteor/versions

accounts-base@1.4.3
accounts-facebook@1.3.2
accounts-google@1.3.2
accounts-oauth@1.1.16
accounts-password@1.5.1
accounts-ui@1.3.1
accounts-ui-unstyled@1.4.1
alanning:roles@1.2.16
aldeed:collection2-core@2.1.2
allow-deny@1.1.0
autoupdate@1.5.0
babel-compiler@7.2.1
babel-runtime@1.3.0
base64@1.0.11
binary-heap@1.0.11
blaze@2.3.3
blaze-html-templates@1.1.2
blaze-tools@1.0.10
boilerplate-generator@1.6.0
caching-compiler@1.2.0
caching-html-compiler@1.1.3
callback-hook@1.1.0
check@1.3.1
dburles:collection-helpers@1.1.0
ddp@1.4.0
ddp-client@2.3.3
ddp-common@1.4.0
ddp-rate-limiter@1.0.7
ddp-server@2.2.0
deps@1.0.12
diff-sequence@1.1.0
dynamic-import@0.5.0
ecmascript@0.12.1
ecmascript-runtime@0.7.0
ecmascript-runtime-client@0.8.0
ecmascript-runtime-server@0.7.1
ejson@1.1.0
email@1.2.3
es5-shim@4.8.0
facebook-oauth@1.5.0
fetch@0.1.0
fortawesome:fontawesome@4.7.0
geojson-utils@1.0.10
google-config-ui@1.0.1
google-oauth@1.2.6
hot-code-push@1.0.4
html-tools@1.0.11
htmljs@1.0.11
http@1.4.1
id-map@1.1.0
inter-process-messaging@0.1.0
jquery@1.11.11
launch-screen@1.1.1
less@2.8.0
livedata@1.0.18
localstorage@1.2.0
logging@1.1.20
mdg:meteor-apm-agent@3.1.2
mdg:validated-method@1.2.0
mdg:validation-error@0.5.1
meteor@1.9.2
meteor-base@1.4.0
meteorhacks:aggregate@1.3.0
meteorhacks:collection-utils@1.2.0
meteorhacks:inject-initial@1.0.4
meteorhacks:meteorx@1.4.1
meteorhacks:zones@1.6.0
minifier-css@1.4.0
minifier-js@2.4.0
minimongo@1.4.5
mixmax:smart-disconnect@0.0.4
mobile-experience@1.0.5
mobile-status-bar@1.0.14
modern-browsers@0.1.2
modules@0.13.0
modules-runtime@0.10.2
mongo@1.6.0
mongo-decimal@0.1.0
mongo-dev-server@1.1.0
mongo-id@1.0.7
mongo-livedata@1.0.12
npm-bcrypt@0.9.3
npm-mongo@3.1.1
oauth@1.2.4
oauth2@1.2.1
observe-sequence@1.0.16
ordered-dict@1.1.0
ostrio:cookies@2.3.0
ostrio:files@1.10.2
percolate:migrations@1.0.2
promise@0.11.1
raix:eventemitter@0.1.3
random@1.1.0
rate-limit@1.0.9
react-meteor-data@0.2.16
reactive-dict@1.2.1
reactive-var@1.0.11
reload@1.2.0
retry@1.1.0
routepolicy@1.1.0
server-render@0.3.1
service-configuration@1.0.11
session@1.1.8
sha@1.0.9
shell-server@0.4.0
socket-stream-client@0.2.2
spacebars@1.0.15
spacebars-compiler@1.1.3
srp@1.0.12
standard-minifier-css@1.5.1
standard-minifier-js@2.4.0
templating@1.3.2
templating-compiler@1.3.3
templating-runtime@1.3.2
templating-tools@1.1.2
tmeasday:check-npm-versions@0.3.2
tracker@1.2.0
ui@1.0.13
underscore@1.0.10
url@1.2.0
webapp@1.7.0
webapp-hashing@1.0.9
cat .meteor/release 

METEOR@1.8

Anyone knows how to solve this issue ? Thanks for helping out :slight_smile:

i have a similar problem and couldn’t track it down yet but i found that it only occours in production. so what i did until i have some more time to investigate was to remove the standard js minifier.

meteor remove standard-minifier-js

hi @chris74656, i tried to remove this package but bug still remains :frowning:

Do you know which browser and version this happens on?

I’ve had a rough time with legacy bundles on Safari before

@coagmano - Safari 9.x do you have some nice points what happened to you and how you fixed it ? :slightly_smiling_face:

@coagmano @chris74656 Actually in my case its unsupported arrow function, i though this is resolved by meteor and ecmascript package.

Do you know how to resolve it ?

22

I fixed it by updating Safari :joy: :sob:

I think using setMinimumBrowserVersions could work?

import { setMinimumBrowserVersions } from "meteor/modern-browsers";

setMinimumBrowserVersions({
safari: 10,
}, "myApp");

Although if the default legacy/modern settings are wrong, you should open an issue on Github so it gets fixed for everyone!


EDIT: I looked at testing the defaults, but Apple don’t make it easy to get/run older versions of Safari.
It’d be nice if they had VMs for testing like Microsoft do for IE


EDIT2: Looking through Meteor, the default minimum modern bundle should already be set to Safari 10:

So it should be getting the transpiled ES5 bundle…
What is the user agent string safari sends?

Maybe open an issue?