magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.55k stars 9.32k forks source link

Magento 2 version 2.4.7-p2 “Page Builder was rendering for 5 seconds without releasing locks” error. #39076

Closed sunit9 closed 2 months ago

sunit9 commented 2 months ago

Preconditions and environment

Magento 2.4.7-p2

Steps to reproduce

1) Login to magento admin 2) Content -> Block -> Add new block 3) Add Block Title 4) Add Identifier 5) Click on Save

Expected result

Block should be save successfully.

Actual result

On screen only loader display and in console getting error. Page Builder was rendering for 5 seconds without releasing locks 2024-08-21_10-22

Additional information

No response

Release note

No response

Triage and priority

m2-assistant[bot] commented 2 months ago

Hi @sunit9. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

Bashev commented 2 months ago

looks like same with this: https://github.com/magento/magento2/issues/37516 and https://github.com/magento/magento2/issues/37798

sunit9 commented 2 months ago

I have check in firefox but not working. My chrome version is Version 127.0.6533.119 (Official Build) (64-bit) I check same things for 2.4.6-p2 and it's working fine.

m2-assistant[bot] commented 2 months ago

Hi @engcom-Bravo. 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:

medigeek commented 2 months ago

I think your problem is with mageno 2.4 and CORS - apache htaccess or nginx requires some tweaking

Check your browser's javascript console log.

Access to script at 'https://example.com/static/versionXXXXXXXXXX/adminhtml/Magento/backend/en_US/requirejs-config.js' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

The solution is explained here: https://magento.stackexchange.com/a/170726

Had the same issue. The above worked for a support case. Hopefully it will work for you too.

From the magento stack exchange:

I faced the same problem with a Magento setup with Nginx.

I share you my working configuration which solve this CORS problem for an headless Magento use case (API).

[...] (don't do the API location /rest as it may break some sites)

Some Allow-Headers is not mandatory, try to test which are on your case.

Then add headers on all other requests :

location ~ (index|get|static|report|404|503)\.php$ {
    .....
    .....

    add_header 'Access-Control-Allow-Origin' '*' always;
    add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
    add_header 'Access-Control-Allow-Headers' 'DNT,Authorization,X-CustomHeader,Keep-Alive,User-Agent,Origin,Referer,X-HTTP-Method-Override,X-Accept-Charset,X-Accept,Accept,Access-Control-Request-Method,Access-Control-Request-Headers,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type' always;
}

Make sure to keep the always option in order to add these headers for response code other than : 200, 201, 204, 206, 301, 302, 303, 304, 307, or 308

Make sure you do not have basic auth authentication behind. If not, update the configuration in order to allow the OPTIONS CORS request made from your browser.

engcom-Bravo commented 2 months ago

@magento give me 2.4.7-p2 instance

magento-deployment-service[bot] commented 2 months ago

Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 2 months ago

Hi @engcom-Bravo, here is your Magento Instance: https://14ab03d38900151067a7d8dc2d86d5f6.instances-prod.magento-community.engineering Admin access: https://14ab03d38900151067a7d8dc2d86d5f6.instances-prod.magento-community.engineering/admin_90c5 Login: ab3740ba Password: 79aeae1bb903

engcom-Bravo commented 2 months ago

@medigeek Thanks for your Contribution!!

Hi @sunit9,

Thanks for your reporting and collaboration.

Could you please refer this comment https://github.com/magento/magento2/issues/39076#issuecomment-2303063100. which resolves your issue and please let us know if you are still facing any issue.

Thanks.

sunit9 commented 2 months ago

I have change in following file vendor/magento/module-page-builder/view/adminhtml/web/template/page-builder.html

<iframe attr="id: 'render_frame_' + id" sandbox="allow-scripts" style="position: absolute; width:0; height:0; border: none;"></iframe>

To

<iframe attr="id: 'render_frame_' + id" sandbox="allow-scripts allow-same-origin" style="position: absolute; width:0; height:0; border: none;"></iframe>

In sandbox i append "allow-same-origin"

It works for me. I do not have idea it's good solution or not. If anyone know then please advise.

chrisoliver90 commented 2 months ago

Adobe Commerce confirmed this issue on our 2.4.7-p1 install and offered us the following patch that fixed it (ACSD-59582_2.4.7) Save as ACSD-59582_2.4.7.patch and add to m2-hotfixes directory

diff --git a/vendor/magento/module-backend/ViewModel/RequireJsConfigModifierInterface.php b/vendor/magento/module-backend/ViewModel/RequireJsConfigModifierInterface.php
new file mode 100644
index 000000000000..07bd7ca989e6
--- /dev/null
+++ b/vendor/magento/module-backend/ViewModel/RequireJsConfigModifierInterface.php
@@ -0,0 +1,22 @@
+<?php
+/**
+ * Copyright 2024 Adobe
+ * All Rights Reserved.
+ */
+declare(strict_types=1);
+
+namespace Magento\Backend\ViewModel;
+
+/**
+ * View model interface for requirejs configuration modifier
+ */
+interface RequireJsConfigModifierInterface
+{
+    /**
+     * Modifies requirejs configuration
+     *
+     * @param array $config requirejs configuration
+     * @return array
+     */
+    public function modify(array $config): array;
+}
diff --git a/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml b/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml
index 6fa41e107995..1b1a5d7fcaf3 100644
--- a/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml
+++ b/vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml
@@ -5,12 +5,20 @@
  */

 /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */
+/** @var \Magento\Backend\Block\Page\RequireJs $block */
+
+$requireJsConfig = [
+    'baseUrl' => $block->getViewFileUrl('/'),
+];
+
+$configModifier = $block->getConfigModifier();
+$requireJsConfig = $configModifier instanceof \Magento\Backend\ViewModel\RequireJsConfigModifierInterface
+    ? $configModifier->modify($requireJsConfig)
+    : $requireJsConfig;

 $scriptString = '
     var BASE_URL = \'' . /* @noEscape */ $block->getUrl('*') . '\';
     var FORM_KEY = \'' . /* @noEscape */ $block->getFormKey() . '\';
-    var require = {
-        \'baseUrl\': \'' . /* @noEscape */ $block->getViewFileUrl('/') . '\'
-    };';
-
-echo /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false);
+    var require = ' . /* @noEscape */ json_encode($requireJsConfig) .';';
+?>
+<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false) ?>
diff --git a/vendor/magento/module-page-builder/ViewModel/StageRenderFrameRequireJsConfigModifier.php b/vendor/magento/module-page-builder/ViewModel/StageRenderFrameRequireJsConfigModifier.php
new file mode 100644
index 000000000..1ae244b03
--- /dev/null
+++ b/vendor/magento/module-page-builder/ViewModel/StageRenderFrameRequireJsConfigModifier.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Copyright 2024 Adobe
+ * All Rights Reserved.
+ */
+declare(strict_types=1);
+
+namespace Magento\PageBuilder\ViewModel;
+
+use Magento\Backend\ViewModel\RequireJsConfigModifierInterface;
+use Magento\Framework\View\Element\Block\ArgumentInterface;
+
+/**
+ * Modifies requirejs configuration for the stage render frame
+ *
+ * Override the text! plugin within the iframe to ensure we can pipe any XHR requests through to the parent window
+ * as the same origin policy will not allow us to load the templates within this iframe.
+ * It is important that this mapping is configured before requirejs-config.js to ensure the text! plugin is overridden
+ * for all requests.
+ */
+class StageRenderFrameRequireJsConfigModifier implements ArgumentInterface, RequireJsConfigModifierInterface
+{
+    /**
+     * @inheritDoc
+     */
+    public function modify(array $config): array
+    {
+        $config['map']['*'] = array_merge(
+            $config['map']['*'] ?? [],
+            [
+                'text' => 'Magento_PageBuilder/js/master-format/render/requirejs/text',
+                'Magento_PageBuilder/js/events' => 'Magento_PageBuilder/js/master-format/render/events'
+            ]
+        );
+        return $config;
+    }
+}
diff --git a/vendor/magento/module-page-builder/view/adminhtml/layout/pagebuilder_stage_render.xml b/vendor/magento/module-page-builder/view/adminhtml/layout/pagebuilder_stage_render.xml
index 6a95e8e87..c40005870 100644
--- a/vendor/magento/module-page-builder/view/adminhtml/layout/pagebuilder_stage_render.xml
+++ b/vendor/magento/module-page-builder/view/adminhtml/layout/pagebuilder_stage_render.xml
@@ -14,6 +14,13 @@
         <remove src="css/styles.css"/>
     </head>
     <body>
+        <referenceBlock name="require.js">
+            <arguments>
+                <argument name="config_modifier" xsi:type="object">
+                    Magento\PageBuilder\ViewModel\StageRenderFrameRequireJsConfigModifier
+                </argument>
+            </arguments>
+        </referenceBlock>
         <referenceContainer name="backend.page" remove="true"/>
         <referenceContainer name="menu.wrapper" remove="true"/>
         <referenceContainer name="root">
diff --git a/vendor/magento/module-page-builder/view/adminhtml/templates/stage/render.phtml b/vendor/magento/module-page-builder/view/adminhtml/templates/stage/render.phtml
index 6e96a2757..2586df2b3 100644
--- a/vendor/magento/module-page-builder/view/adminhtml/templates/stage/render.phtml
+++ b/vendor/magento/module-page-builder/view/adminhtml/templates/stage/render.phtml
@@ -10,33 +10,16 @@
  */
 ?>

-<?php
-/**
- * Override the text! plugin within the iframe to ensure we can pipe any XHR requests through to the parent window
- * as the same origin policy will not allow us to load the templates within this iframe.
- */
-?>
 <?php
 $pageBuilderConfig = $block->getPageBuilderConfig();

-$script = <<<SCRIPT
-   require.config({
-       'map': {
-           '*': {
-               'text': 'Magento_PageBuilder/js/master-format/render/requirejs/text',
-               'Magento_PageBuilder/js/events': 'Magento_PageBuilder/js/master-format/render/events'
-           }
-       }
-   });
-SCRIPT;
-
 /**
  * To be able to override the text plugin we need the Magento template engine to be used, as the template engine
  * within lib has a dependency on the text! plugin we need to ensure we set the template engine before the
  * dependency blocks us. If we try to just override using the RequireJS config above our !text plugin will never
  * get overridden as our template engine cannot load.
  */
-$script .= <<<SCRIPT
+$script = <<<SCRIPT
     require([
         'ko',
         'Magento_Ui/js/lib/knockout/template/engine'
diff --git a/vendor/magento/module-page-builder/view/adminhtml/web/template/page-builder.html b/vendor/magento/module-page-builder/view/adminhtml/web/template/page-builder.html
index 8b495ce72..1ff74d860 100644
--- a/vendor/magento/module-page-builder/view/adminhtml/web/template/page-builder.html
+++ b/vendor/magento/module-page-builder/view/adminhtml/web/template/page-builder.html
@@ -31,6 +31,7 @@
         <with args="stage">
             <render></render>
         </with>
-        <iframe attr="id: 'render_frame_' + id" sandbox="allow-scripts allow-same-origin" style="position: absolute; width:0; height:0; border: none;"></iframe>
+        <!-- Do not modify the "sandbox" attribute without approval from a security engineer -->
+        <iframe attr="id: 'render_frame_' + id" sandbox="allow-scripts" style="position: absolute; width:0; height:0; border: none;"></iframe>
     </if>
 </div>
hostep commented 2 months ago

Adding allow-same-origin is considered a security issue according to the comment in the patch mentioned above. So I wouldn't do that.

Based on the patch above (thanks @chrisoliver90!), here are commits that fix this in Magento OS modules:

medigeek commented 2 months ago

@hostep I don't understand, was this released with 2.4.7 / 2.4.7-p2 ? Is this patch available somewhere? Is this added to the release notes? AFAICS this affects 2.4.7-p2.

medigeek commented 2 months ago

OK so I tried out and noticed that the latest versions of backend and page builder modules don't have this code included.

Having another go at this, these are the composer-compatible patches:

fix-backend-error-page-builder-when-editing-cms-block.patch

fix-error-page-builder-when-editing-cms-block.patch

engcom-Bravo commented 2 months ago

@hostep @chrisoliver90 Thanks for your Contribution!!

As per this comment https://github.com/magento/magento2/issues/39076#issuecomment-2306918383 we are closing this issue.

Thanks.

medigeek commented 2 months ago

@engcom-Bravo was this issue documented in 2.4.7 and 2.4.7-p2 release notes? When can we expect this bugfix issue to be released as a version or an official patch? Thank you.

sunit9 commented 2 months ago

Is any one has tried this solution into Magento CE 2.4.7-p2 ? I tired but not working.

medigeek commented 2 months ago

@sunit9 it should, as far as I can see the change in code removed the allow-same-origin but didn't include the workaround code in the patch. After the patch you have to do a full reocmpile/redeploy. If it doesn't work, check your full javascript logs for maybe some other errors to solve the issue. Also, if you're using cloudflare, try without the cloudflare proxy.

hostep commented 2 months ago

Magento's quality patches 1.1.50 got released today and also contains patches for this problem for various versions of Magento: https://github.com/magento/quality-patches/compare/e8ad81921a...d2e5320f05#diff-5c6d9dd586fe0c5875aa848aad7a1d0729ff28ff44d8bb8d3bec92dfa02f3207R12282-R12311

sunit9 commented 2 months ago

@medigeek I got following error in console after apply

fix-backend-error-page-builder-when-editing-cms-block.patch

fix-error-page-builder-when-editing-cms-block.patch

[2024-08-28 02:37:57] [ERROR] Page Builder was rendering for 5 seconds without releasing locks.

image

I am working on my local system. So no cloudflare proxy

amiyoghoshstar commented 2 months ago

Same happneing with me! Is it related to chrome browser?

medigeek commented 2 months ago

@sunit9 try reproduce in vanilla magento (clear new installation of magento)

anjali25021995 commented 2 months ago

@hostep I got following the still we are getting the issue

https://github.com/magento/magento2-page-builder/commit/70634ffe92c416e70c5c477f95619850b11f1a9d https://github.com/magento/magento2/commit/ab5947b73e08fef9f1b02d1c31b5ea882410f685

image

Please fix this issue ASAP

daniel-zaretsky1 commented 2 months ago

After applying the new patch released ACSD-60169 we are still experiencing this issue in all browsers tested (Chrome/Firefox/Safari). Recompiled we experience that this issue sporadically resurfaces when saving. Sometimes the saves are successful in Firefox, other times we get the [ERROR] Page Builder was rendering for 5 seconds without releasing locks. In almost all cases using chrome it fails. Before our workaround was to just use Firefox to update CMS Blocks/Pages but not anymore since we're experiencing this in it as well now.

anjali25021995 commented 2 months ago

@daniel-zaretsky1 Yes, we are not getting the every time the issue was coming sporadically resurfaces when saving, sometimes the save successful(Chrome/Firefox/), and other times we get the [ERROR] Page Builder was rendering for 5 seconds without releasing locks, permanent fix, can you let us know we are using open source Magento 2,4,7-p2

medigeek commented 2 months ago

Not sure if this will help your issue. It helped us solve some CSP errors. Try adding something similar to your app/etc/env.php You probably need to adapt your env.php file per use case (it contains a php array, consult with your developer). do a full re-deploy/re-compile.

It might be regarded as a security issue, but it will probably make your site work, until you find a more secure long-term solution.

    'system' => [
        'default' => [
            'csp' => [
               'mode' => [
                  'storefront_checkout_index_index' => [
                     'report_only' => '1'
                  ],
                  'admin_sales_order_create_index' => [
                    'report_only' => '1'
                  ]
               ],
               'policies' => [
                  'storefront_checkout_index_index' => [
                    'scripts' => [
                        'inline' => '1'
                    ]
                  ],
                  'admin_sales_order_create_index' => [
                    'scripts' => [
                        'inline' => '1'
                    ]
                  ]
               ]
            ]
        ]
    ]
anjali25021995 commented 2 months ago

Magento 2 version 2.4.7-p2(CE), “Page Builder was rendering for 5 seconds without releasing locks” error. we applied the patch but still got the error ACSD-59582_2.4.7.patch, anyone please provide the solution

medigeek commented 2 months ago

did you guys do a composer update ? which version of composer info -a magento/module-page-builder are you using? you ought to be using v2.2.5-p2 (marked with an asterisk next to it) with magento 2.4.7-p2

anjali25021995 commented 2 months ago

Yes, we are using composer update, our page builder version is v2.2.5-p2 with magento2.4.7-p2, this page builder version correctly still we are getting the issue "“Page Builder was rendering for 5 seconds without releasing locks”

medigeek commented 2 months ago

@anjali25021995 try reproduce the issue in plain vanilla magento (default theme and default clean magento installation) if possible.

sunit9 commented 2 months ago

@medigeek Not working in vanilla installation. I tried env.php solution also.

@engcom-Bravo Please re-open this issue.

chrisoliver90 commented 2 months ago

@medigeek The patch I provided (ACSD-59582_2.4.7) was sent to us directly from Adobe Commerce. I don't believe a quality patch is in place yet but they replicated the issue and sent us that patch which worked.

jmonrove commented 2 months ago

This is still an issue

medigeek commented 2 months ago

@sunit9 try the patch from chris in comment above: https://github.com/magento/magento2/issues/39076#issuecomment-2306661703

sunit9 commented 2 months ago

@medigeek this patch looks like. So it may not work.

https://github.com/magento/magento2-page-builder/commit/70634ffe92c416e70c5c477f95619850b11f1a9d https://github.com/magento/magento2/commit/ab5947b73e08fef9f1b02d1c31b5ea882410f685

This may work in Adobe commerce but not working in Community Edition. I think need to re-open issue for CE.

medigeek commented 2 months ago

@sunit9 you could reopen the issue or open a new issue at page builder: https://github.com/magento/magento2-page-builder/issues also mention this issue and this discussion ( https://github.com/magento/magento2/issues/39076 )

Watch3ruk commented 2 months ago

issue is not resolved on MOS . Could this be reopened please

daniel-zaretsky1 commented 2 months ago

Adobe support recommended us to try another patch: ACSD-48857 this had to do with certain aged pages + blocks not being properly parsed by page builder after an AC version upgrade was performed and revisited. This patch was the solution for us that fixed the issue.

medigeek commented 1 month ago

well in our case it returned, the solution was to add the nginx configuration headers as mentioned above: https://github.com/magento/magento2/issues/39076#issuecomment-2303063100

don't add the API-related location /rest { ... } as it may break the site

I added this snippet in PHP entry point for main application location ~ ^/(index|get|static|errors/report|errors/404|errors/503|health_check)\.php$ { ... }

and in: location /media/ { ... } location /static/ { ... }

The snippet:

#Fix CORS and magento page builder issue
#https://github.com/magento/magento2/issues/39076
#https://magento.stackexchange.com/a/170726
    add_header 'Access-Control-Allow-Origin' '*' always;
#add_header 'Access-Control-Allow-Credentials' 'true';
    add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
    add_header 'Access-Control-Allow-Headers' 'DNT,Authorization,X-CustomHeader,Keep-Alive,User-Agent,Origin,Referer,X-HTTP-Method-Override,X-Accept-Charset,X-Accept,Accept,Access-Control-Request-Method,Access-Control-Request-Headers,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type' always;

secure or not, it works. until magento open source provides a proper fix for this. We don't all have access to ACSD patches unfortunately.

hostep commented 1 month ago

To repeat myself, there are patches included for this in the magento quality patches repository, you can find them in the os and commerce directories.

They are defined like this for various versions of Magento and should be applied to 2 different magento packages:

    "ACSD-59514": {
        "categories": [
            "Admin"
        ],
        "title": "Fixes the issue where forms in the Admin area with Page Builder throw the error \"Page Builder was rendering for 5 seconds without releasing locks.\" in the browser console after submitting the form, and changes can't be saved.",
        "packages": {
            "magento/magento2-base": {
                ">=2.4.4 <2.4.4-p9 || >=2.4.5 <2.4.5-p8 || >=2.4.6 <2.4.6-p6": {
                    "file": "os/ACSD-59514_2.4.4-p8.patch"
                },
                ">=2.4.4-p9 <2.4.5 || >=2.4.5-p8 <2.4.6 || >=2.4.6-p6 <2.4.7": {
                    "file": "os/ACSD-60169_2.4.6-p6.patch"
                },
                ">=2.4.7 <2.4.7-p2": {
                    "file": "os/ACSD-59582_2.4.7.patch"
                }
            },
            "magento/module-page-builder": {
                ">=2.2.2 <2.2.2-p9 || >=2.2.3 <2.2.3-p8 || >=2.2.4 <2.2.4-p6": {
                    "file": "commerce/ACSD-59514_2.2.2-p7.patch"
                },
                ">=2.2.2-p9 <2.2.3 || >=2.2.3-p8 <2.2.4 || >=2.2.4-p6 <2.2.5": {
                    "file": "commerce/ACSD-60169_2.2.4-p6.patch"
                },
                ">=2.2.5 <2.2.5-p2": {
                    "file": "commerce/ACSD-59582_2.2.5.patch"
                }
            }
        }
    },
medigeek commented 1 month ago

@hostep I admire the commitment but unfortunately for some reason ACSD-59582_2.4.7.patch on 2.4.7-p2 doesn't work when applied (i.e. successfully applied but doesn't fix the issue). The only fix that would work was the nginx in my case. mileage may vary obviously.

Watch3ruk commented 2 weeks ago

fixed this for me : [2.4.7-p2 and 2.4.7-p3 MOS ] check that around line 78 in .../vendor/magento/module-require-js/Block/Html/Head/Config.php you have :

    protected function _prepareLayout()
    {
        $after = $this->getInsertAfter() ?: RequireJsConfig::REQUIRE_JS_FILE_NAME;

not

  protected function _prepareLayout()
    {
$after = RequireJsConfig::REQUIRE_JS_FILE_NAME;
aamoronatti commented 2 weeks ago

I applied all the patches and It wasn't working for me. I purged cloudflare's cache and the page started saving correctly. Maybe this might help someone.

vivekmehta17 commented 1 week ago

Hi All,

Tried solution for above issue on Magento2.4.7-p2 working fine and page builder issue not coming now.

create app/code/Vendor/Module/view/adminhtml/requirejs-config.js var config = { map: { '*': { 'Magento_PageBuilder/template/page-builder.html': 'Vendor_Module/template/page-builder.html'

    },
}

};

app/code/Vendor/Moduleview/adminhtml/web/template/

<div class="pagebuilder-stage-wrapper" css="Object.assign( {'stage-full-screen': isFullScreen, 'stage-content-snapshot': isSnapshot, 'transition-out': isSnapshotTransition, 'stage-is-active': (!isSnapshot() || isFullScreen)}, viewportClasses)" ko-style="wrapperStyles"> <div class="admin__field pagebuilder-header" css="visible: panel.isVisible(), 'transition-out': isSnapshotTransition()" if="!isSnapshot()">

    </span>
    <span class="template-buttons">
        <button type="button" translate="'Apply Template'" if="isAllowedTemplateApply" click="toggleTemplateManger"></button>
        <button type="button" translate="'Save as Template'" if="isAllowedTemplateSave" click="saveAsTemplate"></button>
        <i click="toggleFullScreen.bind($data, {animate:true})"
           css="'icon-pagebuilder-fullscreen': !isFullScreen(), 'icon-pagebuilder-fullscreen-exit': isFullScreen()"
           attr="{title: isFullScreen() ? $t('Close Full Screen') : $t('Open in Full Screen')}">
        </i>
    </span>
</div>
<with args="panel">
    <render></render>
</with>
<if args="isStageReady">
    <with args="stage">
        <render></render>
    </with>
    <!-- Do not modify the "sandbox" attribute without approval from a security engineer -->
    <iframe attr="id: 'render_frame_' + id" sandbox="allow-scripts allow-same-origin" style="position: absolute; width:0; height:0; border: none;"></iframe>
</if>

smartexcan commented 1 week ago

I believe I've found the root of the CORS issue described in https://github.com/magento/magento2/issues/39076#issuecomment-2303063100

Earlier this year, changes were made to the Csp module to add subresource integrity to js files.

While originally intended to only be added for checkout and order payment pages, currently it is applied to the 'requirejs-config.js' file on every page in storefront and adminhtml.

We're currently still using the 2.4.6 release line, and these changes look to have been added in 2.4.6-p6.

I created a small module to fix the issue only on the pagebuilder_stage_render page. https://github.com/smartexcan/magento2-page-builder-require-js-fix

hostep commented 1 week ago

Thanks for the hint @smartexcan, I'll link to https://github.com/magento/magento2/issues/39250 which is now very closely related to this issue I believe.

lohoy commented 4 days ago

Hello,

I have this issue on Magento 2.4.7-p3.

To fix that I applied this patch on requirejs module ACSD-52041_2.4.6.patch (https://github.com/magento/quality-patches/blob/3dc08f7af47d38494acb750bed18372a1c65e752/patches/os/ACSD-52041_2.4.6.patch#L4) And this patch on pagebuilder module https://github.com/magento/magento2-page-builder/commit/70634ffe92c416e70c5c477f95619850b11f1a9d On the version 2.4.7-p3 the file app/code/Magento/PageBuilder/view/adminhtml/web/template/page-builder.html was change but not the other files.