Skip to content
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

Minification failure #585

Closed
jaragunde opened this issue May 2, 2022 · 4 comments · Fixed by #587
Closed

Minification failure #585

jaragunde opened this issue May 2, 2022 · 4 comments · Fixed by #587

Comments

@jaragunde
Copy link
Member

When running the minification process on my development box, I'm getting an error in the tasks page: Uncaught TypeError: this.monthPicker is null. The error is located in the datepickerplus component.

I think it must be related with software versions. My software:

  • Fedora 34
  • uglify-js 3.15.3

We have to be aware of this reproducing in production servers, it currently doesn't. They use uglify-js 3.12.8.

As a workaround, removing the -c -m flags fixes the problem. This change produces slightly heavier JS files (from ~700 KB to ~900 in tasks page).

@jaragunde
Copy link
Member Author

Update: it's only needed to remove -c. The JS used in the tasks page weights ~800 KB in this case.

@anarute
Copy link
Member

anarute commented May 23, 2022

The production server now uses uglify-js 3.15.4 so I temporarily committed to remove the -c flag there until we figure a better solution.

@jaragunde
Copy link
Member Author

I would commit the same change to master. The difference in weight of the minified JS is not big with/without -c, we can make this permanent and prevent mistakes or oversights in the future. Honestly, we need a more modern approach to the front-end anyway 🙂

jaragunde added a commit that referenced this issue May 25, 2022
Disable `-c` parameter in UglifyJS to prevent the error. This
increases the output size a bit, but only slightly (from ~700 KB to
~800 in tasks page).

Also write down the minimum UglifyJS version number known to prevent
problems with the most modern JS syntax features.
jaragunde added a commit that referenced this issue Jun 3, 2022
Disable `-c` parameter in UglifyJS to prevent the error. This
increases the output size a bit, but only slightly (from ~700 KB to
~800 in tasks page).

Also write down the minimum UglifyJS version number known to prevent
problems with the most modern JS syntax features.
@jaragunde
Copy link
Member Author

Reviewed in PR#587:

commit 4c7a338786ff3e3eaa5f778da349bf286762974a 
Author: Jacobo Aragunde Pérez <jaragunde@igalia.com>
Date:   Wed May 25 12:46:41 2022 +0200

    [#585] Workaround for minification error in tasks page.
    
    Disable `-c` parameter in UglifyJS to prevent the error. This
    increases the output size a bit, but only slightly (from ~700 KB to
    ~800 in tasks page).
    
    Also write down the minimum UglifyJS version number known to prevent
    problems with the most modern JS syntax features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants