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
JS minification failing and slowly destroying my life #11930
Comments
OK, I was able to create a repro: https://github.com/drone1/minify-hell-repro.git (repro instructions included) Significant commits:
In case it's useful, my modified
Full path: Please let me know if you'd like me to remove |
Your app is using a very old version of standard-minifier-js: Usually when you update the Meteor release, it also updates the minifier. I'm not sure why it didn't for your app. |
@zodern Hey, I saw this after posting and have been testing again. Thanks for checking. Yes, I was somehow using Unfortunately, while my minify-hell-repro repo no longer actually reproduces the issue (even with my package.json/npm-shrinkwrap.json again), I still get errors in my own project, after having removed New errors below, from my project, which are using the exact same package.json, npm-shrinkwrap.json, and .meteor/{packages,versions,release,platforms} files. Any clues as to what is happening? Is there a flag I can pass or config I can edit to get more context from the babel parse error? Thank you!
|
The error is happening while creating a The error is from parsing the minified code at
|
@zodern OK, that allowed me to pass the minification stage and run my server in Any idea why this is happening? |
Except, now, hilariously, I just see the error in the inspector console when I point Chrome at my local server. So there is a real error there that doesn't exist when the code isn't minified. Any suggestions on how to get additional details? Digging through this minified source file hasn't been very useful. |
By the way, why is |
I found the commit where the error began (which was months ago, but I had not deployed), using a (thank you,
Is there no way to get additional details from the minifier? I'm in I looked into connecting Chrome/inspector to the node process but I'm guessing I need to run meteor from source in order to break on a line like this, since I don't see this file anywhere? I've read and followed the instructions on https://github.com/meteor/meteor/blob/devel/DEVELOPMENT.md, have an alias to my local copy of Suggestions still welcome though. :) |
I'm wondering if during your update to 2.6 you also ran the meteor command for updating all the packages. meteor update --all-packages |
[SOLVED]Alright, I very carefully isolated the line that broke everything in my commit back in November. The minification error was tested with and Meteor 2.6 / standard-minifier-js@2.8.0 and [older versions] Meteor Here is the code that was breaking minification with an extremely obscure error and very little information: And this code does not break minification: getAnimAmount is a local function and broke the minifier. Changing that code from a
does not break the minifier. Please let me know if I can provide more detail. Takeaways/requests:
I will see if I can find a repro for my repo repro and update that soon, and will report back here. (@alanionita: Thanks for the response. Yes I ran that command and it didn't change the error.) |
[Reproduction]If anyone is interested, I put together a bare minimum repro case in this repo, created with You can see in hell.js what breaks and doesn't break minification in Meteor 2.6 &
|
We've suffered through issues like this before as well and it's really frustrating. There was a PR open #10006 to add an error message when it fails so you can at least see where the issue is and fix it quicker - but it was closed without merging. It'd be great to get something like that included both in the regular standard minifier & zodern's fork. |
We narrowed down the problem to the package terser (that we use to minify our code). We opened an issue there terser/terser#1155. We are studying the replacement of terser by esbuild. Soon we'll create a PR with a proposal. |
Hi, This should be fixed now with the new version 2.7. I'm closing this for now. |
I'm just going to say first and foremost that I can't deploy my app for the Meteor 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 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 usezodern:standard-minifier-js
/zodern:hide-production-maps
(see fullpackages
andversions
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 wordclass
as I mentioned:Errors right afterwards:
.meteor/packages:
.meteor/versions:
.meteor/release:
package.json:
npm-shrinkwrap can be found here: https://pastebin.com/puXCsBNs
The text was updated successfully, but these errors were encountered: