Okay
  Public Ticket #3057076
Compilation error
Closed

Comments

  • luzaka started the conversation

    Hello,

    When I try to compile with this command 'bin/magento setup:di:compile' I get a lot of errors that I didn't get before installing the theme. (as you can see below)
    I'm on Magento 2.4.3 (I did send the patch_for_magento_2.4.3)

    How can I fix this problem?   

    Thanks

    Attached files:  t2.PNG

  • [deleted] replied

    Hi luzaka,

    Did you check your php version? This issue look like error from php version not fit with magento version.

    Regards,

    Hyun

  • luzaka replied

    Hi Hyun,

    My php version is 7.4.23

    I had already tried to compile it before installing the theme and it passed but now I don't know why i get this 

    Best Regards

    Luzaka

  • [deleted] replied

    Hi luzaka,

    I understand, I will check and fix. Please wait. I will response you soon.

    Regards,

    Hyun

  • [deleted] replied

    Hi luzaka,

    This issue come from some permission. You can find solution here. Hope it helpful

    https://stackoverflow.com/questions/71805796/syntax-error-unexpected-expecting-variable-t-variable-or-or

    https://github.com/composer/composer/discussions/10473

    Regards,

    Hyun

  •  1
    Guilherme replied

    Hello Hyun,

    I'm having the exact same issue under similar conditions (Magento 2.4.3-p1 / PHP 7.4.27 - Magento was installed trough cloudways "one click installer")
    I'm trying to solve everything out using the links that you've posted but I can't see how they can help in this case and even how they're related to the file permissions that you've stated.

    Altough the links discusses the same outputted error, it seems to me that they're not related at all. 
    Can you please help me out being more specific?


    Thank you!

  •  1
    Guilherme replied

    Hello all,

    for those of you who are facing the same problem, it seems that the issue is caused by the Posts.php file from the Blog Module, specifically, on line 23. This file can be found on the following path: app/code/MGS/Blog/Block/Category/Posts.php.

    I've removed the comma after "array $data = []" and now I can setup:di:compile succesfully. I'm not sure If I'm supposed to do this or if something else should be placed after the comma but, well, it worked.

    Please note that I'm not a theme developer. This is a temporary solution and should not be used on a production website.

    I'm still wating for the definitive solution backed by the developers. 

    Thank you.

  • [deleted] replied

    Hi guilhermemenezeseng

    You can refer to apply patch below.

    Thanks a lot.

    Attached files:  patch_fix_blog_post.zip