首页 > 解决方案 > 错误:不匹配的匿名定义()模块 Magento 2.3

问题描述

我对客户 Magento 2.3 商店有疑问。在控制台中我看到 js 错误“错误:不匹配的匿名定义()模块:函数(d){return c(d,a,b),d.mobile}”。我已经阅读了一些关于问题的主题,它看起来像调用未“定义”的函数/模块。

这是导致每个前端页面出现问题的代码:

<script>
require.config({
    map: {
        '*': {
            wysiwygAdapter: 'mage/adminhtml/wysiwyg/tiny_mce/tinymce4Adapter'
        }
    }
});
</script>

代码从以下位置加载:

/vendor/magento/module-ui/view/base/templates/wysiwyg/active_editor.phtml

这是我尝试过的:

define('config', function () {
        require.config({
            map: {
                '*': {
                    wysiwygAdapter: '<?php /* @noEscape */ echo $block->getWysiwygAdapterPath(); ?>'
                }
            }
        });
    });

当我使用定义错误消失但我不确定该解决方案时。我有第二个 magento 2.3 全新安装,有相同的 magento 文件,但不是每页都加载一个,因此必须从某些模块/加载器添加客户端商店脚本。这是解决这个问题的正确方法吗?

非常感谢您的帮助。祝你今晚愉快!

标签: javascriptmagentorequirejsmagento2

解决方案


推荐阅读