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

JavaScript minification erroneously removes // from JavaScript strings #12286

Closed
navarr opened this issue Nov 15, 2017 · 5 comments
Closed

JavaScript minification erroneously removes // from JavaScript strings #12286

navarr opened this issue Nov 15, 2017 · 5 comments
Labels
Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@navarr
Copy link
Member

navarr commented Nov 15, 2017

When the minifier encounters a // in the middle of JavaScript, even when in a string, the minification will ignore it and everything afterwards.

Preconditions

  1. Magento 2

Steps to reproduce.

  1. Apply this patch
  2. Run test Magento\Framework\View\Test\Unit\Template\Html\MinifierTest::testMinify

Expected result

The test finished successfully.

Actual result

The test fails.

@magento-engcom-team magento-engcom-team added Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Nov 15, 2017
@magento-engcom-team
Copy link
Contributor

@navarr, thank you for your report.
We've created internal ticket(s) MAGETWO-84212 to track progress on the issue.

@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Nov 21, 2017
@pemann
Copy link

pemann commented Jun 14, 2018

Any news on this one?

@pemann
Copy link

pemann commented Jun 14, 2018

Magento uses JShrink library to minify js files. That library version 1.3.0 has some problems with minifying. See: tedious/JShrink#72
Magento should either change the library or provide fix for it.

@yosefkurniawan
Copy link

Try this workaround: #5835 (comment)
It works for me by adding the configuration directly to database (table core_config_data) to exclude the js.
The one with modifying the config.xml might work too, I did try that but didn't work for me.

@magento-engcom-team
Copy link
Contributor

@navarr, thank you for your report.

Unfortunately, we are archiving this ticket now as it did not get much attention from both Magento Community and Core developers for an extended period. This is done in an effort to create a quality, community-driven backlog which will allow us to allocate the required attention more easily.

Please feel free to comment, reopen or create new ticket according to the Issue reporting guidelines
if you are still facing this issue on the latest 2.4-develop branch. Thank you for collaboration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

5 participants