Magento2: Marketing Email preview doesn't work with enabled js minification

Created on 15 Oct 2019  路  36Comments  路  Source: magento/magento2

Preconditions (*)

  1. Magento 2.3.2-p2, Magento 2.3.3, Magento 2.3-devlop
  2. Enable JS minification in Admin >> Stores >> Configuration >> JavaScript Settings >> "Minify JavaScript Files" set to "Yes"
  3. Switch magento to production mode

Steps to reproduce (*)

  1. Go to Admin >> Marketing >> Communications >> Email Templates
  2. Click "Add New Template"
  3. Select "New Order" template
  4. Click "load template" button
  5. Fill up "Template Name" with "New Order"
  6. Click "Save Template" button
  7. In the email templates grid click on "Preview" link in "Actions" column

Expected result (*)

  1. You should see email template preview in opened popup
  2. There should not be any JS errors

Actual result (*)

  1. Email Preview popup is empty
    image
  2. We have JS error
    image

Failed to load resource: the server responded with a status of 404 ()
Uncaught Error: Script error for: jquery

Backend Email Fixed in 2.3.x Fixed in 2.4.x Confirmed Format is valid Ready for Work Reproduced on 2.3.x

Most helpful comment

All 36 comments

Hi @ihor-sviziev. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [x] Summary of the issue
  • [x] Information on your environment
  • [x] Steps to reproduce
  • [x] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@ihor-sviziev do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [x] yes
  • [ ] no

Hi @shikhamis11. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 5. Add label Issue: Confirmed once verification is complete.

  • [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.

@magento give me 2.3-develop instance

Hi @shikhamis11. Thank you for your request. I'm working on Magento 2.3-develop instance for you

Hi @shikhamis11, here is your Magento instance.
Admin access: https://i-25068-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

Hello @ihor-sviziev
thank you for reporting this issue , I checked it on 2.3-develop instance email template preview works fine , there are some errors on console but those are related to CORS .
Can you Please take a look ?

Hi @shikhamis11,
Now 2.3.3 release was merged, could you double check it again?

@magento give me 2.3-develop instance

Hi @ihor-sviziev. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@magento give me 2.3-develop instance

Hi @ihor-sviziev. Thank you for your request. I'm working on Magento 2.3-develop instance for you

Hi @ihor-sviziev, here is your Magento instance.
Admin access: https://i-25068-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@shikhamis11 just updated steps to reproduce, we have to have production mode, while on test instance we don't have production mode :(

Hello @ihor-sviziev you can have production mode in test instance
Just add pub/testing in instance url

@magento give me 2.3-develop instance

Hi @ihor-sviziev. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@magento give me 2.3-develop instance

Hi @ihor-sviziev. Thank you for your request. I'm working on Magento 2.3-develop instance for you

Hi @ihor-sviziev, here is your Magento instance.
Admin access: https://i-25068-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

I was able to reproduce this issue on test instance.

Just updated issue description with exact steps to reproduce and screenshots of actual result.

:white_check_mark: Confirmed by @shikhamis11
Thank you for verifying the issue. Based on the provided information internal tickets MC-22163 were created

Issue Available: @shikhamis11, _You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself._

@magento give me 2.3-develop instance

Hi @LucasCalazans. Thank you for your request. I'm working on Magento 2.3-develop instance for you

Hi @LucasCalazans, here is your Magento instance.
Admin access: https://i-25068-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

Hi @arnobsh. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • [ ] 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
  • [ ] 2. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


Internal Magento team is working on this issue right now

The issue is, that somehow jquery.js is requested while jquery.min.js should be loaded. A workaround until the actual solution is found is to create a symlink named jquery.js that points to jquery.min.js in pub/static/versionxxx/adminhtml/Magento/backend/en_US.

Of course replace versionxxx and en_US to your appropriate paths, versionxxx is only needed when static signing enabled.

Hi @ihor-sviziev, @arnobsh.

Thank you for your report and collaboration!

The issue was fixed by Magento team.

@magento-engcom-team where is the fix?

Hi @ihor-sviziev, @arnobsh.

Thank you for your report and collaboration!

The issue was fixed by Magento team. The fix was delivered into magento/magento2:2.3-develop branch(es).
Related commit(s):

The fix will be available with the upcoming 2.3.5 release.

hello guys, i just faced this issue one 2.3.3 and searched for this ticket and that it hopefully will be fine on 2.3.5.

i would only like to note that i did try to copy paste the jsuery.min.js to jquery.js and i get an error: Uncaught SyntaxError: Unexpected end of input for jquery.js

the actual file is this one if you would like to have a look.
https://tyanabelle.com/pub/static/version1576220203/adminhtml/Magento/backend/en_US/jquery.js

Thank you for your time and effort.

Hi @ihor-sviziev, @arnobsh.

Thank you for your report and collaboration!

The issue was fixed by Magento team. The fix was delivered into magento/magento2:2.4-develop branch(es).
Related commit(s):

The fix will be available with the upcoming 2.4.0 release.

Hey @magento-engcom-team

Were these commits deleted? The commit page for both commits is not found

Still happening in 2.3.3-p1. The system is looking for jquery.js instead of jquery.min.js.

A quick (temporary) solution would be to duplicate jquery.min.js and rename it to jquery.js in pub/static/adminhtml/Magento/backend/en_US

Was this page helpful?
0 / 5 - 0 ratings