I'm just going to say first and foremost that I can't deploy my app for the Mete…or 2.6/MongoDB 5.0 compatibility at the moment, unless I upgrade to a dedicated Atlas server (from M2). I've been working for days trying to figure this issue out and it's been very stressful. I know you all are very busy but your suggestions would be greatly appreciated. I have already posted on the forums for days now with very little activity, and it was suggested by a Meteor team member that I post here. I'm the only developer and trying to build a business and have spent nearly 4 days on this now. Thanks in advance for any help.
I've seen similar [issues dating back to 2015](https://github.com/meteor/meteor/issues/5387) with no concrete solution other than "it went away when I upgrade to Meteor 1.blah".
The issue is that **uglify-js is choking on ES6+ code and croaking during minification**, for example, at that keyword ``class``.
This happens when running a server with --production or deploying to Galaxy.
**Repro repo in my comment below.**
(I had to instrument uglify-js's parse.js to get this info since there was no information at all printed other than ``Unexpected token: name (EventDispatcher).``)
I'm using ``standard-minifiers-js@1.0.3-modules.8`` (``minifiers-js@1.1.8-modules.8``), but I get a similar error if I attempt to use ``zodern:standard-minifier-js``/``zodern:hide-production-maps`` (see full ``packages`` and ``versions`` files below).
Whether I'm running Meteor 2.6, 2.7-beta0, or 2.2 (the last version of Meter I was running before updating to 2.6). For now, I'm sticking with **Meteor 2.6** since it doesn't seem to make a difference. What was the last version of Meteor where this did not occur? It would have been 2.2, however, I'm on a new laptop and the old laptop is temporarily inaccessible. The working/inaccessible laptop (which is way behind on commits) runs MacOS, whereas this laptop is running **Windows 10.0.19042 Build 19042** with **WSL1 / Ubuntu 20.04.3 LTS**.
The project resides in a Windows folder that is accessed from WSL via ``/c/mnt/Users/....``. I mention this because trying to run a server on ``/home/....`` in WSL has different errors, about missing permissions to rename a file. That's a separate issue, though.
Unsurprisingly, the errors go away if standard-minifier-js is removed from the project.
Output from my ``uglify-js/parse.js instrumentation in ~/.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js`` below. I print some context code before & after the error position is just after the word ``class`` as I mentioned:
```
const StreamReadUsage = 35041;
const StaticCopyUsage = 35046;
const DynamicCopyUsage = 35050;
const StreamCopyUsage = 35042;
const GLSL1 = '100';
const GLSL3 = '300 es';
/**
* https://github.com/mrdoob/eventdispatcher.js/
*/
class EventDispatcher {
addEventListener(type, listener) {
if (this._listeners === undefined) this._listeners = {};
const listeners = this._listeners;
if (listeners[type] === undefined) {
listeners[type] = [];
}
if (listeners[type].indexOf....
```
Errors right afterwards:
```
=> Errors prevented startup:
While minifying app code:
/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:196:18:
Unexpected token: punc ())
at new JS_Parse_Error
(/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:196:18)
at js_error
(/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:204:11)
at croak
(/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:700:9)
at token_error
(/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:708:9)
at unexpected
(/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:714:9)
at expr_atom
(/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:1209:13)
at maybe_unary
(/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:1383:19)
at expr_ops
(/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:1418:24)
at maybe_conditional
(/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:1423:20)
at maybe_assign
(/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:1447:20)
While minifying app code:
/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:196:18:
Unexpected token: name (EventDispatcher)
at new JS_Parse_Error
(/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:196:18)
at js_error
(/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:204:11)
at croak
(/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:700:9)
at token_error
(/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:708:9)
at unexpected
(/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:714:9)
at semicolon
(/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:734:43)
at simple_statement
(/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:914:73)
at
/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:787:19
at
/home/.../.meteor/packages/standard-minifiers-js/.1.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:747:24
at block_
(/home/.../.meteor/packages/standard-minifiers-js/.2.0.3-modules.8.1a6kq7r.cg82++os+web.browser+web.cordova/plugin.minifyStdJS.os/npm/node_modules/meteor/minifiers-js/minifiers-js/node_modules/uglify-js/lib/parse.js:1027:20)
=> Your application has errors. Waiting for file change.
```
.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.5.1 # Packages every Meteor app needs to have
mobile-experience@1.1.0 # Packages for a great mobile UX
mongo@1.14.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
es5-shim@4.8.0 # ECMAScript 5 compatibility for older browsers.
ecmascript@0.16.1 # Enable ECMAScript2015+ syntax in app code
shell-server@0.5.0 # Server-side component of the `meteor shell` command
ostrio:flow-router-extra
dynamic-import@0.7.2
email@2.2.0
mdg:seo
fongandrew:find-and-modify
mdg:meteor-apm-agent
yasinuslu:blaze-meta
facts@1.0.9
meteorhacks:ssr
session@1.2.0
seba:minifiers-autoprefixer
okgrow:analytics
check@1.3.1
underscore@1.0.10
nolimits4web:swiper
accounts-password@2.2.0
froatsnook:valid-email
spacebars-compiler
http@1.4.2
mdg:validated-method
ddp-rate-limiter@1.1.0
server-render@0.4.0
dburles:collection-helpers
ostrio:flow-router-meta
jquery
typescript@4.4.1
aldeed:collection2@3.0.0
aldeed:schema-deny
alanning:roles
meteortesting:mocha
tunifight:loggedin-mixin
fourseven:scss
standard-minifiers-js
```
.meteor/versions:
```
accounts-base@2.2.1
accounts-password@2.2.0
alanning:roles@3.4.0
aldeed:collection2@3.5.0
aldeed:schema-deny@3.0.0
allow-deny@1.1.1
autoupdate@1.8.0
babel-compiler@7.8.0
babel-runtime@1.5.0
base64@1.0.12
binary-heap@1.0.11
blaze@2.5.0
blaze-html-templates@1.2.1
blaze-tools@1.1.2
boilerplate-generator@1.7.1
caching-compiler@1.2.2
caching-html-compiler@1.2.1
callback-hook@1.4.0
check@1.3.1
dburles:collection-helpers@1.1.0
ddp@1.4.0
ddp-client@2.5.0
ddp-common@1.4.0
ddp-rate-limiter@1.1.0
ddp-server@2.5.0
diff-sequence@1.1.1
dynamic-import@0.7.2
ecmascript@0.16.1
ecmascript-runtime@0.8.0
ecmascript-runtime-client@0.12.1
ecmascript-runtime-server@0.11.0
ejson@1.1.1
email@2.2.0
es5-shim@4.8.0
facts@1.0.9
fetch@0.1.1
fongandrew:find-and-modify@1.0.0
fourseven:scss@4.15.0
froatsnook:valid-email@1.0.0
geojson-utils@1.0.10
hot-code-push@1.0.4
html-tools@1.1.2
htmljs@1.1.1
http@1.4.4
id-map@1.1.1
inter-process-messaging@0.1.1
jquery@3.0.0
launch-screen@1.3.0
livedata@1.0.18
localstorage@1.2.0
logging@1.3.1
mdg:meteor-apm-agent@3.4.1
mdg:seo@3.3.0
mdg:validated-method@1.2.0
meteor@1.10.0
meteor-base@1.5.1
meteorhacks:ssr@2.2.0
meteortesting:browser-tests@1.3.5
meteortesting:mocha@2.0.3
meteortesting:mocha-core@8.1.2
minifier-css@1.6.0
minifiers-js@1.1.8-modules.8
minimongo@1.8.0
mobile-experience@1.1.0
mobile-status-bar@1.1.0
modern-browsers@0.1.7
modules@0.18.0
modules-runtime@0.12.0
mongo@1.14.4
mongo-decimal@0.1.2
mongo-dev-server@1.1.0
mongo-id@1.0.8
mongo-livedata@1.0.12
nolimits4web:swiper@4.4.1
npm-mongo@4.3.1
observe-sequence@1.0.19
okgrow:analytics@0.2.3
ordered-dict@1.1.0
ostrio:flow-router-extra@3.7.5
ostrio:flow-router-meta@2.1.1
ostrio:flow-router-title@3.2.1
promise@0.12.0
raix:eventemitter@1.0.0
random@1.2.0
rate-limit@1.0.9
react-fast-refresh@0.2.2
reactive-dict@1.3.0
reactive-var@1.0.11
reload@1.3.1
retry@1.1.0
routepolicy@1.1.1
seba:minifiers-autoprefixer@1.2.1
server-render@0.4.0
service-configuration@1.3.0
session@1.2.0
sha@1.0.9
shell-server@0.5.0
socket-stream-client@0.4.0
spacebars@1.2.0
spacebars-compiler@1.3.0
standard-minifiers-js@1.0.3-modules.8
templating@1.4.1
templating-compiler@1.4.1
templating-runtime@1.5.0
templating-tools@1.2.1
tmeasday:check-npm-versions@1.0.2
tracker@1.2.0
tunifight:loggedin-mixin@0.1.0
typescript@4.4.1
ui@1.0.13
underscore@1.0.10
url@1.3.2
webapp@1.13.0
webapp-hashing@1.1.0
yasinuslu:blaze-meta@0.3.3
```
.meteor/release:
```
METEOR@2.6
```
package.json:
```
{
"name": "...",
"private": true,
"scripts": {},
"dependencies": {
"@babel/runtime": "^7.9.2",
"@easypost/api": "^3.7.0",
"@paypal/checkout-server-sdk": "^1.0.1",
"@vimeo/player": "^2.16.3",
"adaptive-bezier-curve": "^1.0.3",
"async": "^2.6.2",
"aws-cloudfront-sign": "^2.2.0",
"aws-sdk": "^2.1036.0",
"babel-polyfill": "^6.26.0",
"babel-runtime": "^6.26.0",
"batchelor": "^2.0.2",
"bcrypt": "^5.0.1",
"bitly": "^6.0.8",
"blueimp-load-image": "^5.10.0",
"bullmq": "^1.10.0",
"chart.js": "^2.9.4",
"clone-deep": "^4.0.1",
"connect-route": "^0.1.5",
"cookieconsent": "^3.1.0",
"core-js": "^2.6.5",
"crypto-js": "^4.1.1",
"date-diff": "^0.2.1",
"deep-object-diff": "^1.1.0",
"detector-webgl": "^2.0.0",
"digest-fetch": "^1.2.1",
"dropbox-v2-api": "^2.4.5",
"force-graph": "^1.33.1",
"format-email": "^0.1.0",
"google-spreadsheet": "^3.2.0",
"googleapis": "^91.0.0",
"hls.js": "^0.10.2-canary.3983",
"hmac-auth-express": "^4.1.0",
"hmmac": "^0.2.2",
"http-headers-validation": "^0.0.1",
"i18n-iso-countries": "^3.7.8",
"iplocation": "^6.1.0",
"jquery": "^3.5.1",
"js-base64": "^2.5.1",
"lodash": "^4.17.21",
"md5": "^2.2.1",
"memoizee": "^0.4.15",
"meteor-node-stubs": "^0.4.1",
"mime-types": "^2.1.34",
"mimemessage": "^1.0.5",
"mongodb": "^4.2.0",
"music-metadata-browser": "^1.0.0",
"object-sizeof": "^1.5.1",
"postprocessing": "^6.5.0",
"qrcode-reader": "^1.0.4",
"random-seed": "^0.3.0",
"rectangle-overlap": "^2.0.0",
"request-promise-native": "^1.0.7",
"shippo": "^1.3.1",
"simpl-schema": "^1.12.0",
"simple-hmac-auth": "github:drone1/simple-hmac-auth",
"sprintf": "^0.1.5",
"stats.js": "^0.17.0",
"stripe": "^6.30.0",
"three": "^0.134.0",
"three-line-2d": "^1.1.6",
"useragent": "^2.3.0",
"yamlparser": "0.0.2"
},
"devDependencies": {
"chai": "^4.3.6",
"command-line-args": "^5.2.1",
"command-line-usage": "^5.0.5",
"currency-converter": "^0.1.12",
"git-cz": "^4.8.0",
"gm": "^1.23.1",
"replace-ext": "^1.0.0"
},
"config": {
"commitizen": {
"path": "git-cz"
}
}
}
```
npm-shrinkwrap can be found here: https://pastebin.com/puXCsBNs