Skip to content

Error in cms listing page in the administration #16

@HB0N0

Description

@HB0N0

After opening the shopping experiences listing page (/#/sw/cms/index) in the administration I get the following error:

Uncaught (in promise) SyntaxError: Invalid argument
    createCompileError webpack-internal:///./node_modules/@intlify/message-compiler/dist/message-compiler.esm-bundler.js:68
    createI18nError webpack-internal:///./node_modules/vue-i18n/dist/vue-i18n.esm-bundler.js:118
    tc webpack-internal:///./node_modules/vue-i18n/dist/vue-i18n.esm-bundler.js:1095
    $tc webpack-internal:///./node_modules/vue-i18n/dist/vue-i18n.esm-bundler.js:2029
    getPageType webpack-internal:///./src/module/sw-cms/page/sw-cms-list/index.js:481
    ...

After that my shopware administration stops working until I reload the browser window.

Possible fix:

The error is caused by the new blog_detail page type introduced by this plugin. The listing page tries to translate the name of the cms pages and fails for blog_detail because the name and type ist not known to shopware.

My temporary fix is registering the new page type when the administration loads.

// on administration load
const cmsPageTypeService = Shopware.Service('cmsPageTypeService');
cmsPageTypeService.register({
    name: 'blog_detail',
    icon: '',
    title: "werkl-blog.blocks.blog.detail.label",
    class: [],
    hideInList: false,
});

Further informations:

  • While chasing down the error i discovered that shopware added a cms-aware flag in Shopware 6.5.x which should auto add custom cms-pages to the cmsPageTypeService in the administration.
  • If the plugin gets deactivated or uninstalled without deleting the database entries this error occurs too (I think this can only be fixed in the shopware main codebase or by renaming the blog_detail to a type known by shopware)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions