0

Magento 2.4.2 admin invoice does not render the CSS on certain invoices - the page shows up without any styling. (Some older invoices do still render properly as they should). So it seems that the code errors in certain circumstances.

To see the invoice: Magento admin > sales > invoice then click on VIEW ( Any of the invoice)

I don't see any Log Errors in this regard.

Browser Console Error says "uncaught reference error: require is not defined"

The "require is not defined" is after the first line: <script>require(['prototype'], function(){

The referenced code is:

<script>require(['prototype'], function(){
 submitComment = function() {
 submitAndReloadArea($('comments_block').parentNode, 'https\u003A\u002F\u002Fwww.EXAMPLEDOMAIN.com\u002Fcgscp2\u002Fsales\u002Forder_invoice\u002FaddComment\u002Fid\u002F4650\u002Fkey\u002F359a264374d55ffc26772041f6b5e9e90434d8b1da91d085acebb4ccaf28a36a\u002F')
 };
 if ($('submit_comment_button')) {
 $('submit_comment_button').observe('click', submitComment);
 }
});</script>

So since the page loads fine with some invoices and not others, I'm guessing the code is perhaps buggy with its [comment submission] script section. Not sure.

Any help will be greatly appreciated.

Sweety Masmiya
1,34211 silver badges21 bronze badges
asked Sep 24, 2021 at 0:34

1 Answer 1

0

This patch will resolve that issue.

Follow the steps below: Install the latest quality patches package: ./composer require magento/quality-patches Apply the patch: ./vendor/bin/magento-patches apply MDVA-36021 Clean the cache: ./bin/magento cache:clean

answered Dec 8, 2021 at 9:27
1
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review Commented Dec 8, 2021 at 10:11

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.